Need Help Inserting Dynamic list of images using Advanced Document Templating

Hello,

We would like to insert a dynamic number of images into a document that looks like the following, using the Advanced Document Templating Plugin:

Entry 1:

Data for Entry 1

Image for Entry 1

Entry 2:

Data for Entry 2

Image for Entry 2

...

Entry n:

Data for Entry n

Image for Entry n

Is there a way to do this?  It does seem possible to put a dynamic number of images all together using a list and the bookmark like so:

«[#list logo as logo]»

«[/#list]»

but is there a way to put in a dynamic number of images separately?

  Discussion posts and replies are publicly visible

Parents
  • As far as I'm aware you need to have a static bookmark to reference each document. What you can do though is make 20+ bookmarks all called bookmark1, bookmark2, etc. and then in the smartservice dynamically generate a dictionary using the updatedictionary plugin function

  • Hey Danny,

    Thanks for your answer.  The images will be nested in a variable text section as well, so it will be difficult to create all these bookmarks.  For example, if we had a list of companies with the images being the logo, we would want:

    Walmart:

    Number of Employees: 200,000

    Headquarters: Bentonville, AR

    Chipotle:

    Number of Employees: 50,000

    Headquarters: Newport Beach, CA

    ...

    etc.

  • Hi

    When we generate a word document with an image example: {logo: CONS!APP_IMAGE} works perfectly, but when I have more than one image in the template. For example logo2 and I call the smart service as follows {logo: CONS!APP_IMAGE, logo2: CON!APP_IMAGE2} I get the following error: freemarker.core.NonSequenceOrCollectionException: The value you try to list is an extended_hash+string (fr.opensagres.xdocreport.document.images.ByteArrayImageProvider wrapped into f.e.b.StringModel), thus you must specify two loop variables after the "as"; one for the key, and another for the value, like <#... as k, v>). ---- FTL stack trace ("~" means nesting-related): - Failed at: #list logo as logo [in template "fr.opensagres.xdocreport.document.docx.DocxReport@7f2dbfc!word/document.xml" at line 4, column 6773]

    ---- Plugin: Advanced Document Templating Version: 1.1.0 Smart Service: DOCX From Dynamic Template

Reply
  • Hi

    When we generate a word document with an image example: {logo: CONS!APP_IMAGE} works perfectly, but when I have more than one image in the template. For example logo2 and I call the smart service as follows {logo: CONS!APP_IMAGE, logo2: CON!APP_IMAGE2} I get the following error: freemarker.core.NonSequenceOrCollectionException: The value you try to list is an extended_hash+string (fr.opensagres.xdocreport.document.images.ByteArrayImageProvider wrapped into f.e.b.StringModel), thus you must specify two loop variables after the "as"; one for the key, and another for the value, like <#... as k, v>). ---- FTL stack trace ("~" means nesting-related): - Failed at: #list logo as logo [in template "fr.opensagres.xdocreport.document.docx.DocxReport@7f2dbfc!word/document.xml" at line 4, column 6773]

    ---- Plugin: Advanced Document Templating Version: 1.1.0 Smart Service: DOCX From Dynamic Template

Children
No Data