Hi Team,
My requirement is to extract images from document and save into new document.please kindly help me to resolve the issue.(the images are anchored images).
The input Test.zip (1.5 MB)
The expected output ExpectedOutput.zip (1.5 MB)
The actual output actual output.zip (1.5 MB)
Thanks and regards,
priyanga G
@priyanga ,
Thanks for your inquiry. Please use the code example shared in following forum link to get the desired output.
@priyanga ,
Thanks for your inquiry. Please use the following code example to get the desired output.
Document doc = new Document(MyDir + "test.docx");
NodeCollection paragraphs = doc.getChildNodes(NodeType.PARAGRAPH, true);
for (Paragraph paragraph : (Iterable<Paragraph>) paragraphs)
{
if(paragraph.toString(SaveFormat.TEXT).trim().startsWith("FIGURE")
&& paragraph.getAncestor(NodeType.SHAPE) != null)
{
Shape shape = (Shape)paragraph.getAncestor(NodeType.SHAPE);
…