Rtf to html conversion issue with Version 19.8

Hi,

We’re looking at upgrading from version 16.6.0 to 19.8 to use a feature available in 19.8, but the rtf document that we a using isn’t converting correctly to html in 19.8.

My code (This is Aspose Words Java):

        public static void main(String[] args) throws Exception {
        Document doc = new Document("sampletemplate.rtf");

        HtmlSaveOptions options = new HtmlSaveOptions(SaveFormat.HTML);
        doc.save("output.html",options);

        doc.save("output.pdf");

}

The html file produced isn’t formatted correctly(The first section is missing), while the pdf does convert correctly. This works fine for both html and pdf in version 16.6.0.

The rtf file that we’re using:
sampletemplate.zip (1.3 KB)

Ultimately, I want to be able to do:

     Pattern regex = Pattern.compile("\\<clinical comments\\>");
    doc.getRange().replace(regex,"some text \r\n  some more text");

But in 16.6.0 it won’t allow me to use line breaks(and substituting in &l as per the documentation isn’t working). 19.8 allows me to include line breaks in the replace string, but the conversion to html isn’t working correctly.

Is there a way round the formatting issue in 19.8? or alternatively an earlier version in between 16.6 and 19.8 where I can do both the conversion, and the replace operation with line breaks?

@richard.silver,

Please also provide a comparison screenshot highlighting the problematic areas in Aspose.Words 19.8 generated output HTML file with respect to your Word document and attach it here for our reference.

Please also ZIP and attach Aspose.Words 19.8 and Aspose.Words 16.6 generated HTML files here for further testing. Thanks for your cooperation.

Hi,

Screenshot and examples of the files produced in the different versions:

Screenshot and output files.zip (198.4 KB)

Many Thanks.

@richard.silver,

I am afraid, we are unable to reproduce this issue on our end when using the licensed version of Aspose.Words for Java 19.8. Please see following MS Word 2019 and Aspose.Words generated HTML files:

We used the following simple code for testing:

License lic = new License();
lic.setLicense("E:\\temp\\Aspose.Total.Java.lic");
Document doc = new Document("E:\\sampletemplate\\sampletemplate.rtf");
doc.save("E:\\sampletemplate\\awjava-19.8.html");

OK the issue must be related to me using the evalution version, as we don’t have a license for the latest version. We’ll get an upgraded license.

Many thanks for your help.

@richard.silver,

Sure. In case you have further inquiries or need any help in future, please let us know.