Issues with conversion to HTML

I am using Aspose Words version 17.4 and am having trouble converting DOC, DOCX, DOT, DOTX, ODT, OTT to HTML. Each document is the same, just a different format. All conversions seem to have a problem rendering a table. Some have additional interesting results. These are list below.


DOCX - Rendered a large back square over part of the table.
DOT - Failed to render part of some subscripted text.
DOTX - Rendered some text a very large font that was suppose to be subscript, 11 point.
OTT - Highlight one cell of the table with a grey bold border.

Hi there,

Thanks for your inquiry. We have tested the scenario using latest version of Aspose.Words for Java 17.4 and have not found the shared issue. We have attached the output documents with this post for your kind reference. Please make sure that you are using the Aspose.Words for Java 17.4.

If you still face problem, please share following detail here for testing.

  • The screenshots of problematic sections of output documents.
  • If you are using any HtmlSaveOptions, please share the code example.
  • Please share the browser that you are using.
  • Please share your working environment e.g. operating system, .NET framework.

I am using aspose.words-17.4.0-jdk16.jar with Java 8.

I am running on Oracle Linux 6.5.

The screenshots are from Chrome, but problems are also on Firefox.

I have attached screenshots of the problem and have include the code.

FontSettings.getDefaultInstance().setFontsFolder("/ScholarOne/ConversionEngine/fonts/", true);

Document doc = new Document(file.getPath());

String fileNameWithOutExt = FilenameUtils.removeExtension(file.getPath());

doc.save(fileNameWithOutExt + ".html", SaveFormat.HTML);

Hi there,

Thanks for sharing the detail. Please spare us some time to investigate this issue on Linux operating system. We will get back to you soon.

Hi there,

Thanks for your patience.
rridings:
DOCX - Rendered a large back square over part of the table.
DOT - Failed to render part of some subscripted text.
DOTX - Rendered some text a very large font that was suppose to be subscript, 11 point.
OTT - Highlight one cell of the table with a grey bold border.
We have tested the scenario at Ubuntu and have not found the shared issue. Please make sure that you are using latest version of Aspose.Words for Java 17.4. We have attached the output documents with this post for your kind reference. Perhaps, you are facing this issue due to missing fonts. Please refer to the following article:
How to Install True Type Fonts on Linux

Moreover, we have noticed that the font size of superscript and subscript is changed for ODT and OTT files in output HTML. For the sake of correction, we have logged this problem in our issue tracking system as WORDSJAVA-1532. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

I do have the TrueType fonts install as well as many more. There is some font substitution happening, but not in the table. The table text is Calibri. The text renders properly, with the exception of subscript and superscript on Office documents. It is the table layout that gets messed up. I see from your output that you are not seeing the same thing.


I am using Aspose.Words for Java 17.4

Can you share with me the code you are using for the conversion?
Hi there,

Thanks for your inquiry. We used the same code that you are using.

Please note that Aspose.Words mimics the same behavior as MS Word does. Could you please share some more detail about table layout issue? We will then provide you more information on this.

I was able to fix the HTML rendering with the following code change.


HtmlSaveOptions saveOptions =
new HtmlSaveOptions();
saveOptions.setPrettyFormat(true);
saveOptions.setUseHighQualityRendering(true);
saveOptions.setSaveFormat(SaveFormat.HTML);

doc.save(fileNameWithOutExt + “.html”, saveOptions);

I assume that the UseHighQualityRendering is what made the difference. The documentation does not explain exactly what its is doing. Can you provide any information on what this setting is doing?

Thanks


Hi there,

Thanks for your inquiry. It is nice to hear from you that your problem has been solved.

The SaveOptions.UseHighQualityRendering property is used to render the images e.g. Tiff, Png, Bmp, Jpeg, Emf in high quality. The rendering is slow when this property is set to true.

@rridings,

The issues you have found earlier (filed as WORDSJAVA-1532) have been fixed in this Aspose.Words for .NET 17.7 update and this Aspose.Words for Java 17.7 update.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan