We're sorry Aspose doesn't work properply without JavaScript enabled.

# Replace image placeholder with actual image in docx using java

My requirement is like , i want to insert an image in place of a text box containing <<image [image_expression] >> (placeholder) using java.
Could you please provide the sample code (with explanation) for getting placeholder and replacing it with image.
Please guide what kind of image expression should be used.

@Rit365 The expression declared within an image tag must return a value of one of the following types:

• A byte array containing an image data
• An InputStream instance able to read an image data
• A BufferedImage object
• A string containing an image URI, path, or Base64-encoded image data

https://docs.aspose.com/words/java/inserting-images-dynamically/

For example see the following simple code:

Document doc = new Document("C:\\Temp\\in.docx");
ReportingEngine engine = new ReportingEngine();