We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Conversion issue for word file

Hi,
I am trying a word file conversion on CentOS (Input file is attached here), in original file no of pages are 9 and it got converted into 10 pages(attached output file as well).
Looks like in converted file, from page no 3 it takes extra space between the header and the starting content of the page.

We have installed all the fonts available for CentOS7 and MS core fonts as well.
Can you please check this?Aspose_Words_Issue.zip (286.5 KB)

@rutuja.mahajan The problem on your side might occur because the fonts used in the document are not available in the environment where document is processed. To build the document layout Aspose.Words requires the fonts. If Aspose.Words cannot find the fonts used in the document the fonts are substituted . This might lead into the layout difference, since substitution fonts might have different font metrics, and as a result in different number of pages. You can implement IWarningCallback to get a notification when font substitution is performed.
To get the same rendering result on different OSs the same set of fonts should be available in the environments. Please see our documentation to learn how to specify fonts location:
https://docs.aspose.com/words/java/specify-truetype-fonts-location/

The issue was with Symbol font used for indent in word file. For Linux OS we have changed the font name & number format in java code as below and it resolved the issue,

Iterator iterator = doc.getChildNodes(NodeType.PARAGRAPH, true).iterator();
while (iterator.hasNext())
{
    Paragraph para = (Paragraph)iterator.next();
    if (para.isListItem())
    {
        ListLevel level = para.getListFormat().getListLevel();
        if (level.getFont().getName().equals("Symbol") && level.getNumberFormat().equals("\uF0B7"))
        {
            level.getFont().setName("Unicode");
            level.setNumberFormat("\u2022");
        }
    }
}

@rutuja.mahajan It is perfect that you managed to resolve the issue.
This is a known peculiarity. Windows “Symbol” font is a symbolic font (like “Webdings”, “Wingdings”, etc.) which uses Unicode PUA. MacOS or Linux “Symbol” font on the other hand is a proper Unicode font (for example Greek characters are in the U+0370…U+03FF Greek and Coptic block). So these fonts are incompatible and Mac/Linux “Symbol” font cannot be used instead of Windows “Symbol” without additional actions. In your particular case it is required to change the bullet codepoint from PUA U+F0B7 (or U+00B7 which also can be used in MS Word for symbolic fonts) to the U+2022 in the document.