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

Free Support Forum - aspose.com

Extract images from the document based on Fig Caption using Java

Hi team,
I have shared the Input for the parallel fig caption and as well the needed output.

Input File :: Input.zip (175.9 KB)

Output File :: Output.zip (88.9 KB)

Thanks in Advance !!

@Swaran

In your case, we suggest you following solution.

  1. Iterate over paragraph nodes. You can get the paragraph nodes using CompositeNode.GetChildNodes method.
  2. Get the text of Paragraph node using Node.ToString method.
  3. If paragraph text contains “Fig” twice, get the previous Node of Paragraph.
  4. Get the Shape nodes from the previous node of paragraph using CompositeNode.GetChildNodes method.
  5. Insert the Shape node into new document and save it to PDF. You can use NodeImporter.ImportNode method to import a node from one document into another.

Hope this helps you.