Using Aspose Words for Java 22.8 and 23.1, font information is lost in fields where an ODT document is saved after populating fields.
This is demonstrated by the attached zip. This contains:
- ODT Merge Test - original.odt - the source document
- ODT Merge Test 1.pdf - the source document merged and then exported to PDF. This document looks correct
- ODT Merge Test 2.odt - the source document merged and then saved as an ODT. This is incorrect - the field font has changed to the font of the Default style, Times New Roman size 12, and the text is no longer bold
-
ODT Merge Test 3.pdf - the ODT Merge Test 2.odt document exported to PDF.
Provided to compare with the expected result in ODT Merge Test 1.pdf
The following code was used:
Document document1 = new Document("ODT Merge Test - original.odt");
document1.getVariables().set("field", "field value, should be Arial bold size 9");
document1.updateFields();
document1.save("ODT Merge Test 1.pdf");
Document document2 = new Document("ODT Merge Test - original.odt");
document2.getVariables().set("field", "field value, should be Arial bold size 9");
document2.updateFields();
document2.save("ODT Merge Test 2.odt");
Document document3 = new Document("ODT Merge Test 2.odt");
document3.updateFields(); // needed otherwise fields don't appear in PDF
document3.save("ODT Merge Test 3.pdf");
ODT Merge Test.zip (85.3 KB)