HTML Images within custom field value won't display

WordPress
February 21, 2023 06:14:52
underdog
Topics: 6
Messages: 20
Because of the specific way I need to organise the data on my PDF I'm generating field content using ACF's 'acf/load_value' filter and then using the [meta key="key_name"] shortcode within an E2PDF html field to output that field's content on the PDF. This is working fine for text values within the field content. However any images in the field content using the html <img> tag doesn't display anything. The documentation indicates I can use <img> tags in the e2pdf html field so I'm not understanding why the image isn't added to the pdf. Can you provide any guidance on using the <img> tag and where I might be going wrong?
February 21, 2023 06:29:04
E2Pdf
Topics: 7
Messages: 3617
Support
Hi,

It can be caused by:

1. "img" tag doesn't contain "width" / "height" which can be applied to the image, in this case, E2Pdf will try to render "Image" at its original "size". If the "size" is too large - "Image" can be truncated.

If you do not have "width" and "height" set, try to set it as width="100" height="auto" or set them inside the "HTML" field CSS section as

img {
width: 100;
height: auto;
}

2. Images must be available to the public, i.e "img" tag will not work if your website for example is behind "htaccess"

3. Problem can be connected if you have some redirect for "images". This issue must be fixed in the next update.

If you still fail to render an image via "img" tag, output please code how you generate "img" tag, with some example URL to the "image" on your website. You can mark "message" as private so only we can see the message.

We would really appreciate your feedback at WordPress.org!
February 21, 2023 08:11:55
underdog
Topics: 6
Messages: 20
Thanks for the guidance. I think the problem is my staging site is blocked from public access so the image urls aren't accessible. I've hardcoded a public image url and it worked fine. No worries, I'll work round this for now, thanks again!
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.