How To Display Multiple Images Uploaded in GravityForms Multiple File Upload Field inside the PDF template

Gravity Forms
15 December, 2024 19:15:13
sharedteams
Topics: 1
Messages: 3
Hello,

We have a GravityForm with a file upload field that allows for multiple files to be uploaded in the field.

In our e2pdf template, is there a way to visually display ALL of the possible uploaded images? We are curious if there is a way to display them without have to map them each to an individual image field, meaning, is there a way to just have it show ALL the possible images?

Thank you,
16 December, 2024 01:43:33
E2Pdf
Support
Topics: 7
Messages: 3345
Hello,

Currently, the only way to output multiple images is through the "HTML" object. You can use an example value like https://codefile.io/f/Lo8WoqsGg2* along with the "Multipage" or "Parent/Child" functionality. It is recommended to check the option to disable the WYSIWYG Editor.

* {File:32} should be replaced with your multiple-file-upload slug.

If this solution works for you, please let us know which layout you need for the output, and we will provide a more specific example if possible. However, please note that there are some limitations with CSS/HTML usage, and creating the required layout for the output may not always be straightforward.

P.S. We are working on other possible options, such as displaying images in a grid using the Image object. However, this feature will likely only be available next year.
We would really appreciate your feedback at WordPress.org!
17 December, 2024 20:28:07
sharedteams
Topics: 1
Messages: 3
Hello,

We have implemented this approach with the HTML element, but are having an issue where it only works with image files (jpg, png, etc.). The multi-upload fields we have also allow for .PDF uploads, and this worked well when we used an image element, but unfortunately, the image element doesn't work for multi-page options (if there is more than one attached file upload), but additionally the HTML element with this code doesn't seem to support showing a PDF. Is there any way to use the HTML object but also display PDFs like the image object does?
17 December, 2024 23:57:15
E2Pdf
Support
Topics: 7
Messages: 3345
Hello,

Unfortunately, the HTML object does not yet support inserting PDFs as images; only the Image object supports this functionality. This feature is on our TODO list, but we do not have an ETA for its release.

P.S. We are also working on direct attachments to PDFs, which will allow uploaded files to be included directly in the PDF without inserting them into pages. This feature will support multiple file uploads and is expected to be available by early January. However, we’re not sure if it can be a suitable replacement in your case.
We would really appreciate your feedback at WordPress.org!
18 December, 2024 07:01:32
sharedteams
Topics: 1
Messages: 3
Okay, is there a way to use the image object but accomodate for multiple uploads? Perhaps some sort of conditional page display that has new pages for additional file uploads?
18 December, 2024 07:26:03
E2Pdf
Support
Topics: 7
Messages: 3345
You can try using conditional logic to hide pages; however, this would require pre-creating a structure and checking where the value of the shortcode renders as empty.

For example, if it’s two images per page in the multi-file upload field, you should be able to use the shortcode to output:

1st Page:

1st image: [e2pdf-format-output explode=", " output="{0}"]{Upload:4}[/e2pdf-format-output]

2nd image: [e2pdf-format-output explode=", " output="{1}"]{Upload:4}[/e2pdf-format-output]

2nd Page:

1st image: [e2pdf-format-output explode=", " output="{2}"]{Upload:4}[/e2pdf-format-output]

2nd image: [e2pdf-format-output explode=", " output="{3}"]{Upload:4}[/e2pdf-format-output]

-------------------

For the 1st page, you would check if the value for the field is empty or not (Screenshot 1):
[e2pdf-format-output explode=", " output="{0}"]{Upload:4}[/e2pdf-format-output]

For the 2nd page, you would check if the value for the field is empty or not (Screenshot 2):
[e2pdf-format-output explode=", " output="{2}"]{Upload:4}[/e2pdf-format-output]



We would really appreciate your feedback at WordPress.org!