Free Support Forum - aspose.com

How to find Images and retrieve them in a WORD 2007 document

Could you kindly let me know, how to find images present in a WORD document using ASPOSE.Words. Also, please let me know how to retrieve them.

Hi

Thanks for your inquiry. Please try using the following code to extract the images:

// Open document.

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

foreach (Shape shape in doc.GetChildNodes(NodeType.Shape, true))

{

// Check if the shape contains an image.

if (shape.HasImage)

// Save image.

shape.ImageData.Save(string.Format("C:\\Temp\\out.{0}", shape.ImageData.ImageType));

}

Hope this helps.

Best regards,

Thank you for this. I tried implemeting this but I am not able to find "Shape" Class. I am using ASPOSE.WORDS 9.3.0.0. Also, I tried the following to get the shapes, but doc.GetChildNodes(NodeType.Shape, True) return 0 Items.

Dim shapeCollection As NodeCollection = doc.GetChildNodes(NodeType.Shape, True)

Please find the attached document for verification.Could you kindly help on this.

Hi

Thanks for your request. I cannot reproduce the problem on my side using the latest version of Aspose.Words (10.0.0) for testing.

You can download the latest version from here:

http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/category1188.aspx

I use the following code:

// Open document.

Document doc = new Document("C:\\Temp\\Doc_with_Image.doc");

foreach (Shape shape in doc.GetChildNodes(NodeType.Shape, true))

{

// Check if the shape contains an image.

if (shape.HasImage)

// Save image.

shape.ImageData.Save(string.Format("C:\\Temp\\out.{0}", shape.ImageData.ImageType));

}

Best regards,

Hi,

Thank you. Is there any alternate way to find the image using ASPOSE.Words 9.3.0.0. Please advise.

Regards,

Aravind

Hello

Thanks for your inquiry. I just test my code with Aspose.Words 9.3.0 and it works the same way as in the latest version.

Aspose.Words.Drawing.Shape class exists.

Best regards,

Hi,

Thanks for your reply. I am not able to convert the attached document to PDF with a chart image in it, even using the direct conversion. It gets converted to PDF without the chart image. Also, it is not found by doc.GetChildNodes(NodeType.Shape,True).

Grateful, if you could kindly look into this and advise on the same.

Thanks,

Aravind

Hi Aravind,

Thanks for your inquiry.

This issue occurs because DrawingML is currently not fully supported during rendering. Support of rendering these types of charts will be improved over the next few releases. We will keep you informed of any developments.

Also for the same reason, you cannot find the chart by searching for Shape nodes, as the chart is a DrawingML node.

Thanks,

Hi ASPOSE Team,

Could you kindly advise if DrawingML is fully supported during rendering. We would like to identify WORD charts and convert them also in the output PDF.

Thanks,

- Aravind

Hi


Thanks for your request. Unfortunately, currently Aspose.Words does not support rendering of OOXML charts. Your request has been linked to the appropriate issue in our defect database. We will let you know once this feature is available. We already started working on it, so hopefully it will be available soon. But since it is quite complex feature, we cannot give you a solid estimate right now.

Best regards,

The issues you have found earlier (filed as WORDSNET-3860) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(7)

The issues you have found earlier (filed as WORDSNET-6957) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.