We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Set image full path problems

Hi Aspose team,


I am having some problems when parsing a word that has an image inside. What I want is to get the image data, upload to my server and make a link, but it seems it is not working properly.
My aspose version is 10.5 and what I am doing is using a imageSavingCallback like this:
public void imageSaving(ImageSavingArgs e) throws Exception {

Shape s;
String url;
s = (Shape)e.getCurrentShape();
if(s.hasImage() && s.getImageData().isLink()==false){
url = UploadImageUtils.uploadImageArray(s.getImageData().getImageBytes());
s.getImageData().setSourceFullName(url);
s.getImageData().setTitle(url);
s.getImageData().setImageBytes(null);
e.setImageStream(new ByteArrayOutputStream());
e.setKeepImageStreamOpen(false);
}
}
when I get the document text I can see the image src attribute points to the imageFileName aspose gives to that image. Is there any solution to this.

Thanks in an advance!!!

for further information, I am not using imagesFolderAlias cause I want to embed everything in the imageSavingCallback.

Is it possible to do this without setting imageFolderAlias?

update:
As I reported at the live chat I solved it using imagesFolderAlias, but I would like to put it all together inside the imageSavingCalback.
I provide you the doc I am working with.

Thanks again

Hi,


Thanks for your inquiry. We will provide ImageSavingArgs.ImageFilePath property that you can use along with ImageSavingArgs.ImageFileName property to build complete URL of image by staying inside IImageSavingCallback.ImageSaving method. The ID of this issue is WORDSNET-10142. Your request has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

Thank you very much you all!


By the way, shouldn’t imageData sourceFullName property do the same?

Thank yoy again!!

Hi,


Thanks for your suggestion. Our development team will investigate the best possible way to fix the issue and we will inform you via this thread as soon as it is supported.

Best regards,

Hi,


Thanks for being patient. It is to update you that we have decided to add following two properties into ImageSavingArgs class:

public string ImageFolder {get;set;}
public string ImageFolderAlias {get;set;}

The properties will work like ImagesFolder and ImagesFolderAlias properties declared in HtmlSaveOptions class but will affect saved image only. These will allow to specify separate image folder and folder alias for each image. Please let us know if the proposed properties satisfy your requirement.

Best regards,