Hi,
I have been trying to extract image out of a word document and use it to paste in some other document at a particular position.The only help I found with Aspose for accomplishing this was with the following code but apparently it has not worked with me.
I would really appreciate if you could please provide me any sample code/help/pointers for accomplishing this.
For your reference please find the file which hold the image attached to this email.
(I assume this a c# code.I have still not been able to find any help with the java code)
public void ExtractImagesToFiles()
{
Document doc = new Document(MyDir + "Image.SampleImages.doc");
NodeCollection shapes = doc.GetChildNodes(NodeType.Shape, true);
int imageIndex = 0;
foreach (Shape shape in shapes)
{
if (shape.HasImage)
{
string imageFileName = string.Format("Image.ExportImages.{0} Out{1}", imageIndex, FileFormatUtil.ImageTypeToExtension(shape.ImageData.ImageType));
shape.ImageData.Save(MyDir + imageFileName);
imageIndex++;
}
}
}