Wrong page count when convert Doc to Pdf

@ruhongcai,

Regarding WORDSJAVA-1746, it is to update you that we have completed the analysis of this issue. Please use/copy the required Windows fonts on your Linux environment and use the following code to add Windows fonts:

public static void main(String[] args) throws Exception
{
    LoadOptions opt = new LoadOptions();
    FontSettings fontSettings = new FontSettings();

    // Add Windows' fonts folder. It should contain the required (.ttf) font files
    addFontFolder(fontSettings, "subst_fonts");

    opt.setFontSettings(fontSettings);
    com.aspose.words.Document doc = new Document("TestJiraJ1525.docx", opt);

    doc.save("TestJiraJ1525_17.5.pdf");
}

private static void addFontFolder(FontSettings fontSettings, String folder)
{
    FontSourceBase[] fontSourceBases = fontSettings.getFontsSources();
    FontSourceBase[] newFontSourceBases = new FontSourceBase[fontSourceBases.length + 1];
    System.arraycopy(fontSourceBases, 0, newFontSourceBases, 0, fontSourceBases.length);
    newFontSourceBases[newFontSourceBases.length - 1] = new FolderFontSource(folder, true);
    fontSettings.setFontsSources(newFontSourceBases);
}

Aspose.Words does not take into account the “Use printer metrics to lay out document” option if you work in non-windows OS.

It will fix the main problem. However, there could still be some inaccuracies because Non-Windows Aspose.Words does not support the “Use printer metrics to lay out document”

Please re-test the scenario on your end and let us know how it goes? Thanks for your cooperation.

The issues you have found earlier (filed as WORDSNET-16850) have been fixed in this Aspose.Words for Java 22.8 update also available on Maven.