Replace ${sign} with signature image in Word document using java

I am able to replace text placeholders in Word to values with java using docx4j. Can you please suggest me a way how image can be inserted in place of placeholders I am unable to do that, tried to replace placeholder with file byte array stream by converting it to string but its throwing error. Can anybody suggest something on how to replace text with image.
Thanks in Advance

Answer

I am able to solve this by using word bookmarks
1.First add a bookmark in the word template where you need to add an image. This bookmark is used as the basis for positioning.
2. Then find this bookmark in java, generally the bookmarks are in a paragraph, then find the parent paragraph of the bookmark, add the image to this paragraph.
Followed this : https://www.programmersought.com/article/6413972878/

Leave a Reply

Your email address will not be published. Required fields are marked *