Hi,
I am doing a small POC using Aspose.Word.
I am facing a small Issue, hope you may help me with this.
Actually I am loading one doc file using Aspose.Word.
Then I want to get the images present in that file with their name.
I am creating that document using Aspose.Word using and document template and using the mailmerge filed I am assigning the image and image Name there.
Please refer below for details.
«TableStart:testAttachmentInfo»
«Image:objectPath»
«objectFileName»
«TableEnd:testAttachmentInfo»
While generating the document from template I am assigning the image and image name.
Please refer below for the document generated.
Again due to some requirement I am loading the genearted document using Aspose.Word and I need the images present with the name i.e “loading.gif” ihis case.
I am using the below code.
foreach (Section sec in doc.Sections) { NodeCollection shapes = doc.GetChildNodes(NodeType.Shape, true); foreach (Shape shape in shapes) { if (shape.HasImage) { string fileextension = FileFormatUtil.ImageTypeToExtension(shape.ImageData.ImageType).ToLower();
I am using the above code and getting the file extension of image file.
However I have used ImageData.Title and also tried with Shape.Name, however not getting the file name.
Could you please help me in achieving the same?
Please revert in case of any issue.
Thanks,
Rajesh