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

Free Support Forum - aspose.com

System.ArgumentException raised when saving a document with an object in HtmlFixed format

Hi,

we noticed an exception when saving a document with SaveFormat.HtmlFixed. The document cotains a “Designer 3.1” object. Word itself renders the element. When saving to PDF with Aspose it is partly rendered, partly contains a placeholder symbol.
Saving with SaveFormat.Html also works without exception but the placeholder symbol.

The document was submitted by a customer. I myself don´t know what “Designer 3.1” format is, just found very old tools for SVG editing. If embedding the graphic is not supported by Aspose, this is fine for us, however we would expect the placeholder symbol to be added into the SaveFormat.HtmlFixed as well, instead of the exception.

Testcode

            var doc = new Document(@"S:\tmp\doc\test.docx");
            doc.Save(@"S:\tmp\doc\out\out.html", SaveFormat.HtmlFixed);

Testfile
test.docx (55.8 KB)

Thanks for your help

@Serraniel Thank you for reporting the problem to us. I have managed to reproduce it on my side. For sake of correction it has been logged as WORDSNET-23460. We will keep you informed and let you know once the issue is resolved.
As a temporary workaround you can use MetafileRenderingMode.Bitmap like shown in the following code:

Document doc = new Document(@"C:\Temp\in.docx");

HtmlFixedSaveOptions opt = new HtmlFixedSaveOptions();
opt.MetafileRenderingOptions.RenderingMode = MetafileRenderingMode.Bitmap;

doc.Save(@"C:\Temp\out.html", opt);

Thanks, setting the option fixed the workaround. I also tried the behaviour of the Bitmap rendering mode when saving as PDF and can confirm it fixes the placeholder symbols and does a better result as well.

@Serraniel It is perfect that workaround works for you. We will keep you informed and let you know once the original issue is resolved.

The issues you have found earlier (filed as WORDSNET-23460) have been fixed in this Aspose.Words for .NET 22.3 update also available on NuGet.