Generate document - Unkown number of images

Hi!

I’m trying to generate a PDF with several images. Problem is, the number of images varies. Heres my code so far, which generates the PDF correclty however none of the images are included in the PDF.

The images are stored in serviceImagesRT, which is a runtime property with cardinality many. In the code I’m trying to iterate this object class and extract every image

Hi,

The PDF generator doesn’t evaluate JavaScript. Can you provide a static HTML payload instead?

Thanks,
Greg

I’m not sure what a static HTML payload is. But my whole problem here is that the number of images in the PDF is variable, and based on user input.

Hi,

You can try to move your JavaScript outside the HTML template, and create a HTML string that holds all the HTML for your images.

Then you can take the HTML string and insert it into your HTML template the same way you insert variables.

Check this image:

2 Likes

Thanks this worked!

For others struggling with the same, in my case fileContentLink has 2 underscores. Not sure if this is consistent.

That means it should be images.__fileContentLink

1 Like

Great!

Thanks for the clarification. I think dobbel underscore is consistent, yes.