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,
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,
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,
Hi Parag,