HTML Images within custom field value won't display

WordPress
21 February, 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?
21 February, 2023 06:29:04
E2Pdf
Support
Topics: 7
Messages: 3345
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!
21 February, 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!