Convert a docx into html with linked pictures

with version 14.5 it is not possible anymore to save a docx with linked pictures as html and the images pointing to the link defined in docx.

I have in my docx a picture link to a website and the following code:

Aspose.Words.Document aspDoc = new Aspose.Words.Document(@"C:\Users\xxx\Documents\image.docx");

Aspose.Words.Saving.HtmlSaveOptions docsaveoptions = new Aspose.Words.Saving.HtmlSaveOptions(Aspose.Words.SaveFormat.Html);

docsaveoptions.ExportImagesAsBase64 = false;

aspDoc.Save(@"C:\Users\xxx\Documents\image.html", docsaveoptions);

In version 14.4 and previous I got a html as result which contained the images as link and now with 14.5 and 14.6 aspose saves the images locally and references it with the local pictures.

Do you know this bug already ? Is there a fix available?

Hi Christian,

Thanks for your inquiry. Please attach your input Word document and output HTML files showing the undesired behavior here for testing. Please zip these files before attaching. We will investigate the issue on our end and provide you more information.

Best regards,

attached are the files.

The base642.docx is the file with the linked images.
You will see the result as html with the pictures extracted by the aspose component.

Hi Christian,

Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 14.6.0, I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-10539. Your thread has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

Is there any chance that this fix is in the next version included? It is a very important functionality for us.

Hi Christian,

Thanks for your inquiry. Unfortunately, at the moment we cannot provide you any reliable estimate and this issue will not be fixed in next release. We will inform you via this thread as soon as this issue is resolved. We apologize for your inconvenience.

Best regards,

Hi Christian,

Thanks for being patient. Please upgrade to the latest version of Aspose.Words for .NET i.e. 15.7.0 from the following code:

You should set HtmlSaveOptions.ExportOriginalUrlForLinkedImages property to true for exporting original URLs to HTML as follows:

Document doc = new Document(MyDir + @"base642.docx");
HtmlSaveOptions options = new HtmlSaveOptions(SaveFormat.Html);
options.ExportImagesAsBase64 = false;
options.PrettyFormat = true;
options.ExportOriginalUrlForLinkedImages = true;
doc.Save(MyDir + @"15.7.0.html", options);

I hope, this helps.

Best regards,

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

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