@TandFSP
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): WORDSNET-25881
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
As a temporary workaround you can reset paragraph alignment like shown in the following code:
Document doc = new Document("C:\\Temp\\in.doc");
Iterable<Paragraph> paragraphs = doc.getChildNodes(NodeType.PARAGRAPH, true);
for (Paragraph p : paragraphs)
{
if (p.getParagraphFormat().getAlignment() == ParagraphAlignment.DISTRIBUTED)
p.getParagraphFormat().setAlignment(ParagraphAlignment.JUSTIFY);
}
doc.save("C:\\Temp\\out.pdf");
@TandFSP We have completed analysis of the issue and concluded to close it as not a bug. The problem happened because Kerning is enabled in the document. It is required to enable Text Shaping for correct rendering text.
Aspose.Words.Shaping.Harfbuzz package provides support for OpenType features in Aspose.Words using the HarfBuzz text shaping engine. You should enabling open type features to get the result closer to MS Word’s result. To achieve this you should add reference to Aspose.Words Shaping Harfbuzz plugin:
Document doc = new Document("C:\\Temp\\in.docx");
// Enable open type features
doc.getLayoutOptions().setTextShaperFactory(com.aspose.words.shaping.harfbuzz.HarfBuzzTextShaperFactory.getInstance());
doc.save("C:\\Temp\\out.pdf");