Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Download Library https://github.com/dompdf/dompdf/releases Or Use PhP Composer
- // Refer : https://stackoverflow.com/questions/15153139/dompdf-remote-image-is-not-displaying-in-pdf
- // Use Any Image For Directly Not Work Then Use base64_encode Function. URL Or Server Folder Path Both Work
- $profile_image = "data:image/png;base64,".base64_encode(file_get_contents(IMAGE_URL/FOLDER_PATH));
- $dompdf = new Dompdf();
- $dompdf->loadHtml($htmldata);
- $dompdf->render();
- $output = $dompdf->output();
- file_put_contents($path.'pilot_onboarding.pdf', $output); // Generate Specific Location
- // $dompdf->setPaper('A4', 'landscape');
- // $dompdf->stream("Brochure.pdf",array("Attachment" => false)); // Preview Use
- ?>
Add Comment
Please, Sign In to add comment