Free Support Forum - aspose.com

HTML export depends on included fonts in Aspose.Words


#1

If we have a numbered list in a document then the document is exported differently depending on included fonts in Aspose.Words library. The difference is that the exported items starting with 10 doesn’t have “-aw-import” style property if we include the fonts. Can you say why this happens?
I’ve attached a snippet with the document and the font.

Aspose.Words 19.1

numbered_list.zip (421.2 KB)

public class NumberedListTest {
public static void main(String[] args) throws Exception {
    License license = new License();
    license.setLicense(Objects.requireNonNull(NumberedListTest.class.getClassLoader().getResourceAsStream("Aspose.Words.lic")));

    //depending on the presence of the font 'Cambria Bold Italic', conversion to HTML works differently
    FontSettings.getDefaultInstance().setFontsFolders(new String[]{"./fonts"}, false);

    HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions(SaveFormat.HTML);
    htmlSaveOptions.setPrettyFormat(true);
    htmlSaveOptions.setExportListLabels(ExportListLabels.AS_INLINE_TEXT);

    Document doc = new Document(new FileInputStream("./numbered_list.docx"));

    // -aw-import style property for items starting with 10 is absent when we include the font
    doc.save("./numbered_list.html", htmlSaveOptions);

}

}


#2

@rkisin,

We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-18136. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.


#3

@rkisin,

We are currently investigating your issue i.e. WORDSNET-18136; please also ZIP and attach the output files (both with and without Cambria font) generated on your end here for further testing.