I have a class that implements ‘MergeImageFieldEventHandler’. How do I get access to the original image source path/url of the image. By the time the handler get notification of the event, the image has been renamed to ‘Aspose.Words.XXXX’. I want to get access to the original name of the image file name.
public void htmlExportImageSaving(Object arg0, ExportImageSavingEventArgs arg1) throws Exception {
String name = arg1.getCurrentShape().getImageData().getSourceFullName();
// If image came from a url such as 'http://www.somewhere.com/images/image.gif, how do I get this url?
}
Thanks for your inquiry and additional information. Could you please attach your Word document here for testing? Actually, there are few ways to insert an image into a Word document. Images can be embedded (stored in the document)or linked (stored in external resources). If an image is linked then SourceFullName will return path to the linked resource.