New version of aspose words is changing the rendring of text near style changes

Please check the attached screen shot. See the word ‘chest pain’. [chest in bold]
The original document (left) has normal single spacing before the word but when aspose converts the document to html (right) it’s adding extra spacing before word ‘chest’. We are using aspose-words-14.7.0-jdk16.jar .
Earlier we used to use aspose-words-14.4.1-jdk16.jar. There is one difference I observed a difference between the two. aspose-words-14.4.1-jdk16.jar generated html used to have approximately 1 span elements wrapping each word and have absolute position hard coded as value of ‘left’ and ‘right’. But in aspose-words-14.7.0-jdk16.jar I see generated html is having approximately 1 span elements wrapping each ‘Line’ of text instead of word.
So Is this something changed in the version 16 or is there any default settings where I can choose the type of output from either of the above.

I am also attaching the original rtf file which i am using for conversion.

Hi Parag,


Thanks for your inquiry. After an initial test with Aspose.Words for Java 14.8.0, I was unable to reproduce this issue on my side (please see attached out-awjava-14.8.0.html). I would suggest you please upgrade to the latest version of Aspose.Words. You can download it from the following link. I hope, this helps.

Best regards,

Hi Awais,
Can you please share the environment details with me under which you are performing the conversion. Because if you see the generated html content of the file you attached is entirely different. I am attaching my data.rtf.html with this post along with the original rtf file.
I am using java 1.6
and aspose-words-14.8.0-jdk16.jar .

additionally I am using the following settings for HTML Conversion.
final HtmlFixedSaveOptions saveOptions = new HtmlFixedSaveOptions();
saveOptions.setExportEmbeddedCss(true);
saveOptions.setExportEmbeddedFonts(true);
saveOptions.setExportEmbeddedSvg(true);
saveOptions.setSaveFormat(SaveFormat.HTML_FIXED);
saveOptions.setShowPageBorder(false);
saveOptions.setUseHighQualityRendering(true);
return saveOptions;

and following load options.
final LoadOptions loadOptions = new LoadOptions();
loadOptions.setEncoding(Charset.forName(“UTF-8”));

final DocumentBuilder builder = new DocumentBuilder(new Document(docInputStream, loadOptions));
final PageSetup ps = builder.getPageSetup();
ps.setTopMargin(ConvertUtil.inchToPoint(0));
ps.setBottomMargin(ConvertUtil.inchToPoint(0));
ps.setRightMargin(ConvertUtil.inchToPoint(0));
ps.setLeftMargin(ConvertUtil.inchToPoint(0));
return builder.getDocument();


And Please answer my other question If there is any aspose page settings through which i can control the generated HTML like In my attached generated HTML you’ll see there is a span element wrapping each line of text inside it but in the HTML file you attached there is one complete paragraph of text wrapped inside spans.

Hi Parag,


Thanks for your inquiry. Earlier, I did convert your document on a Windows 7 machine to a normal/regular HTML file using the following simple code:

Document doc = new Document(getMyDir() + “data.rtf”);
doc.save(getMyDir() + “out-awjava-14.8.0.html”);

However, PFA another HTML_FIXED html with this post; I have converted this file on Windows 7 machine using JDK 1.6 and Aspose.Words for Java 14.8.0 using your shared code. Could you please try opening this new HTML_FIXED file with latest version of Chrome/IE/FireFox and see how it goes on your end?

Best regards,

Hi Awais,
I am always able to reproduce this on my mac as well as on our production server I am attaching the details of both the hardware and the OS which we are using. We are doing this conversion in a webservice running inside jboss (Version : jboss-as-7.1.1.Final). I am also attaching a screen cast to demonstrate the issue and the code ( java class I am using to to do the conversion). Please check the attachments for all this and let me know.

Hi Parag,


Thanks for the additional information. We are checking with this scenario and will get back to you soon.

Best regards,

Hi Parag,


Thanks for being patient. We tested the scenario on MAC OS and were unable to reproduce this issue on our end. Please see attached output HTML document i.e. produced over MAC. What web browser are you using on your end to view this HTML. Please try other browsers e.g. IE/Chrome/FireFox etc. Also, please upgrade to the latest version of Aspose.Words 14.9.0 from the following link:
http://www.aspose.com/community/files/72/java-components/aspose.words-for-java/default.aspx

I hope, this helps.

Best regards,