Images cut off in PDF

August 27, 2024 03:06:19
mindfulwp
Topics: 2
Messages: 8
Hi, when I generate a PDF from a blog post, I noticed that the any images seem to get cut off in the PDF because they are too large.

For example, if the image is set to 1024px width, then it gets cut off. But if I manually change the image width to 600px then it will appear fine in the PDF.

Is there a setting somewhere to have images automatically "fit" the width of the PDF document? It would be helpful otherwise I have to manually go through all the images in all my blog posts and resize the images to 600px which is tedious.

Thanks!
August 27, 2024 03:20:22
E2Pdf
Topics: 7
Messages: 3621
Support
Hello,

You should be able to modify the "image" size via the CSS section. Images by default will be cut off if they are not fit by height. So you can change the width or set for example auto width but define the height:

width: auto;
height: 100px;

Unfortunately, max-width / max-height isn't yet supported. We are working on the new HTML worker, which should be available next month and it should have support for current settings.

We would really appreciate your feedback at WordPress.org!
August 27, 2024 03:29:23
mindfulwp
Topics: 2
Messages: 8
The problem is with the images that are being pulled in from the blog content area using the shortcode.

I tried adding different kinds of CSS but it doesn't seem to do anything. See here: https://markuphero.com/share/vS4tIVq8GLNpxvtYFpzR
August 27, 2024 03:32:14
E2Pdf
Topics: 7
Messages: 3621
Support
It can be that the image is still too large in height after setting the width to 600px and overflows the "HTML" object.

Can you please try to add CSS as follows:

img {
width: 50px;
height: auto;
}

or

img {
width: auto;
height: 50px;
}

We would really appreciate your feedback at WordPress.org!
August 27, 2024 03:37:02
mindfulwp
Topics: 2
Messages: 8
It seems that the CSS doesn't get applied at all to the images. Here is what I added: https://markuphero.com/share/rZcWZ7mKHrZOuDgavTe7 -- But the images are still being rendered at full size in the PDF.
August 27, 2024 03:44:29
E2Pdf
Topics: 7
Messages: 3621
Support
Can you please place the [e2pdf-download] shortcode on some page, so we can see the PDF render?

P.S. Keep also the "HTML Worker 2.0" option turned on the HTML Worker 2.0, as we see that it's not checked.

We would really appreciate your feedback at WordPress.org!
August 27, 2024 03:58:08
mindfulwp
Topics: 2
Messages: 8
Please disregard my request! It turns out I've been editing the wrong plugin this whole time. I feel so silly. My apologies.
Get News and Updates
Our monthly newsletter keeps you in the loop, so you'll always be up to date with the latest news and updates about E2Pdf.
* You can update your email subscription preferences here.
All trademarks, service marks, trade names, product names, and logos appearing on this website are the property of their respective owners. The use of trademarks such as Formidable Forms®, Forminator Forms®, Gravity Forms®, JetFormBuilder®, WordPress®, WooCommerce®, WPForms® and others is solely for identification purposes (nominative use) and does not imply any affiliation, sponsorship, or endorsement by the respective trademark holders.
© 2017 - 2026, https://e2pdf.com

We use cookies to collect and analyse information on site performance and usage, to provide social media features and to enhance and customise content and advertisements. By clicking "Accept Selected", you consent to use of selected cookies according to our Cookie Policy.