@priyadharshini,
Thanks for your inquiry.
For example, the 37th page of ‘test (8).docx’ contains an image with a ‘bulleted list caption’ i.e. the text ‘(a) Hydrogen mass flow rate’. This list item is basically a Paragraph and you can detect it by using the Paragraph.IsListItem property. You also need to call Document.UpdateListLabels method to be able to correctly read list labels. Once you have found the list item, you then need to ascend up the document hierarchy to find the Shape (it depends on Document Structure). After the Shape is rendered to disk, you can insert it into a new Document. Please see the following code and articles:
Document doc = new Document(MyDir + @"test (8).docx");
doc.UpdateListLabels();
int i = 0;
foreach (Paragraph para in doc.GetChildNodes(NodeType.Paragraph, true))
{
if (para.IsListItem)
{
if (para.ListLabel.LabelString == "(a)")
{
if (para.PreviousPreOrder(doc).PreviousPreOrder(doc).NodeType == NodeType.Shape)
{
Shape shape = (Shape)para.PreviousPreOrder(doc).PreviousPreOrder(doc);
ShapeRenderer renderer = shape.GetShapeRenderer();
renderer.Save(MyDir + "image" + i + ".jpg", new ImageSaveOptions(SaveFormat.Jpeg));
i++;
}
}
}
}
Aspose.Words Document Object Model
Use DocumentBuilder to Insert Document Elements
Hope, this helps.
Best regards,
Awais Hafeez