-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to choose PDF output dpi #32
Comments
Hi @Amosar, thanks for reporting! This is probably caused by the PDF not being wide enough or included images not being high-res enough. I did some testing and gathered some data.. When I create a 16:9 presentation in Keynote, then export it as PDF with 'Image Quality' set to 'best', then upload it to a Foyer PDF slide, the output image on the slide is exactly 1920x1080 pixels (= HD TV resolution). So that's perfect. When inspecting that PDF it has a page size of 67,74 × 38,1 cm. To display a Letter (8,5 x 11 inch) sized PDF crisp contained in a 1080x1920 (portrait) display you would need to render it at 128dpi. This is actually what WordPress is doing for PDFs: https://make.wordpress.org/core/2016/11/15/enhanced-pdf-support-4-7/ Increasing the DPI would work for those 'paper' PDFs, upscaling them, but would result in pretty heavy (3413px wide!) images for PDFs created for screen presentations. So that's not a very tempting solution. Maybe if it would be possible to check the size of the input PDF.. then I could calculate the DPI needed for an image that is exactly contained within 1920x1920. Not sure how though. Any ideas on this? |
I have verified with my pdf and the output resolution is 960 x 540 with 72dpi so this is the problem. And I don't know if it's possible with wordpress but I have found something for converting all pdfs to a resolution close to 1920 x 1080. |
Thanks for all the troubleshooting! So Powerpoint exports PDFs for printing, not for screen usage clearly. Something like I don't see a solution to this problem at the moment. Apart from coding my own PDF conversion mechanism, or just arbitrary doubling the dpi (resulting in huge files and maybe even errors for those uploading PDFs that are correctly sized for screen usage)... |
Could you just let the PDF render client-side using the https://wp-pdf.com/ plugin? I used that on several wordpress installs like: https://bereaacademystl.org/staff/teachers/teachers-handbook/teacher-handbook-2019-2020/ |
Hi,
With the default setting I found the PDF output ugly on my TV so I have modify it from 72 to 96 to improve that but this is reset every update.
Can you please add an option to set a new value ?
https://github.com/mennolui/wp-foyer/blob/master/includes/class-foyer-image-editor-imagick.php#L72
Regards
The text was updated successfully, but these errors were encountered: