Using E2PDF in combination with ACF (Advanced Custom Fields) gallery

WordPress
3 February, 2021 13:27:18
seidelm
Topics: 1
Messages: 3
Hello

I am trying to get images from a ACF into my PDF. I already read that I need to use the "path" parameter to go over the images one by one. But so far I only manage to get the image ID into the PDF. I also used a textarea to print out my images array:

[meta key="boat_images"]
shows:
a:4:{i:0;s:3:"160";i:1;s:3:"162";i:2;s:3:"164";i:3;s:3:"166";}

When I use path like this
[e2pdf-wp key="boat_images" path="0"]
then I get of course the image ID "160" back. But how can I match the image ID with the image URL? Maybe I am doing it totally wrong?
3 February, 2021 14:31:59
E2Pdf
Support
Topics: 7
Messages: 3345
Hi,

You must be able to use one of the following shortcodes to convert image id to image url:

[e2pdf-wp key="boat_images" path="0" attachment_url="true"]

OR

[e2pdf-wp key="boat_images" path="0" attachment_image_url="true" size="full"]

Also if you will need to output is directly as image, it must be used "image" object. Screenshot attached.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
3 February, 2021 20:01:18
seidelm
Topics: 1
Messages: 3
Perfect, thank you for the quick answer. It worked perfectly. My mistake was that I didn't use the image object, but an HTML object instead.

But there is no way that the images build up dynamically in the layout, right? That they have a variable height?
4 February, 2021 06:56:40
E2Pdf
Support
Topics: 7
Messages: 3345
It's possible to use images inside "HTML" object, however it can be some issues as E2Pdf currently doesn't support fully some important tags like wrapping text over image, some style can be rendered incorrectly, etc. We are continuously working on improvements, however it's far away from perfect solution at this moment.

If you still need to use it inside "HTML" object you must be able to use shortcode as , however you must "Disable WYSIWYG Editor" on "HTML" block to have correctly showing typed "HTML" and keep attention on quotes with "src" attribute.

P.S. "Width" also must be set as if not set it will be used original image size.

We remain at your service.

We would really appreciate your feedback at WordPress.org!
4 February, 2021 10:04:27
seidelm
Topics: 1
Messages: 3
Hi Oleksandr

Thanks for the fast reply! I will give it a try if that is a suitable solution for my case, it is good to have that as an optional solution.