Skip to main content
July 18, 2024
Question

Inser 2 images using DocX from Dynamic Template

  • July 18, 2024
  • 5 replies
  • 0 views

Hello Everyone,

I am using DocX from Dynamic Template to insert a signature in a Word document. I need to insert the same image in two different places. While the first signature is working correctly, the second one is not updating as expected and remains the same. I have uploaded the Template, XML code, Images code, and the generated document for your review. Please let me know if there's an issue with my configurations.

Thank you in advance!

XML:

= "
" & cons!SIGNATURES[1] & "
"

Images perameter:

= {signature: cons!SIGNATURES[1]}

[View:/cfs-file/__key/communityserver-discussions-components-files/19/Two_5F00_signatures_5F00_Template.docx:320:240]

[View:/cfs-file/__key/communityserver-discussions-components-files/19/Result_5F00_File.docx:320:240]

5 replies

July 18, 2024

This issue is resolved. 

Thanks.

July 18, 2024
Good to hear that your issue is resolved.  What was the issue and how did you resolve it?
November 15, 2024

Hi! We are actually having a problem with this. We are mapping the image in the xml code and also in the image parameter on the docx from dynamic template smart service. We also have a bookmark on our docx template.
Could you tell us how you solved our problem please?

We are having this 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@250d2e8d!word/document.xml" at line 4, column 930] ----

November 20, 2024

Hi, you will have to pass an array of images , you must be passing only one image in images parameter. try passing more than on and this error would be resolved 

Thanks

May 26, 2026

Hi i have one doubt, how do you get the signature in the word document dynamically , i mean in xml template what should be written for the signature part?