mpdf generates pdf without images - php

I use mpdf for a php project but I am having difficulties generating pdf file with images. it displays the pdf file correctly on browsers but after I save the pdf file it doesnt display the images. I tried it with different browsers/OS and the result is little bit strange to me. it works on very browser and displays local pdf file correctly on linux machine. mac and windows it displays images on every browser but when I save the pdf file it doesnt display the images on local pdf. do you have any idea how to solve this problem.
Thanks

you have to use absolute linking, starting all the way at the top with the domain name.

Related

PDF Content get changed From Application view to downloaded files

I am using TCPDF to generate the PDF, when I open a PDF file on my browser within the application use, with URL viewDocument.php look like these,
And when it is downloaded, view downloadDocument.php
Not understanding why this problem is occurring, really do not understand.Please Help!!

dynamically give pdf path in pdf.js using php mysql

I've developed a small application in php and mysql, where i'm uploading pdf and moving file to UPLOADS folder and storing path in database.
But in viewing after passing path i'm not able to open pdf on browser.
I've uploaded PDF.JS files in my folder aswel.
Below are my testing urls.
http://www.farukhzama.com/fileupload/index.php
http://www.farukhzama.com/fileupload/view.php
Your link is :
http://www.farukhzama.com/fileupload/viewer.html?file=uploads/47920-ombudsman-acknowledgement.pdf at view.php file, which is wrong path to get the pdf file.
Give it right path like this => http://www.farukhzama.com/fileupload/uploads/47920-ombudsman-acknowledgement.pdf
Thanks!

Codeigniter mpdf is not displaying images in live server

I have used mpdf for my codeigniter Project to print ticket with header image and it is working in my local machine while I moved source to test server, the images are not displaying in generated PDF.
Is the Permission issue? Is the invalid SSL issue?
I faced the issue once. You may use the image extension .jpg. It seems mpdf in some live server only accepts .jpeg images. Check with .jpeg images
Note: Don't just manually change the extension. The mime type should be of jpeg image(image/jpeg).

dompdf image not found on live server

After several hours of searching, I am still unable to resolve this issue. I am having a problem with displaying images in a PDF file generated by dompdf library.
I have an editor tinyMCE where a user can upload images, edit his page, and see a preview in PDF format with a Button press.
One important thing here: I am using 'convert_urls : true' in tinyMCE's configuration which converts the image src = "https://mysite.com/public/images/image_name.png", necessary for the PDF library to display them.
I set the required dompdf configurations:
def("DOMPDF_ENABLE_REMOTE", true);
Here I found that it will appear after changing the attached CSS with a dompdf like:
img { display:block }
All still in vain.
Note: Everything is working fine on localhost. But on the staging server, I get a message box having a cross inside it saying "image not found" and displaying the image path. When I click on that path, the image is already there on my server. I wonder why dompdf is giving me this message?
I already faced same kind of issue. solution is very simple when Dompdf does not accept url with http format. Try with full document root.
Instead of using https://example.com/public/images/image_name.png try with /var/www/mysite/public/images/image_name.png
Use a absolute path for external css and images than live path! its worked for me also

how to make thumbnail from a .swf in php?

I have to make thumbnails from banners in swf file format (flash 9). I want to use php, but if that's not possible anything which work in a linux command line is fine by me.
I tried to open them with ffmpeg-php, but it says: Can't open movie file /where/the/file/is
The file is there and is readable by the user.
Any ideas?

Categories