OpenOffice user fields lose styling

If an OpenOffice ODT is loaded with user fields that have modified styles, saving it back to ODT loses the modified styles. They revert to the base style.

In the attached .zip there are 4 documents:

  • UserFieldStyleTest4.odt - the original document
  • UserFieldStyleTest4-merged.odt - the merged document, saved to ODT. This demonstrates loss of styling. [1]
  • UserFieldStyleTest4-merged.pdf - the merged document, saved to PDF. This looks correct. [2]
  • UserFieldStyleTest4-merged2.pdf - generated from UserFieldStyleTest4-merged.odt. This demonstrates loss of styling [3]

The following code was used:

Document document = new Document("UserFieldStyleTest4.odt");
document.getVariables().add("field", "Test Value 1");
document.updateFields();
document.save("UserFieldStyleTest4-merged.odt");  // [1] loss of style information
document.save("UserFieldStyleTest4-merged.pdf");  // [2] this looks OK

Document converter = new Document("UserFieldStyleTest4-merged.odt");
converter.updateFields();
converter.save("UserFieldStyleTest4-merged2.pdf"); // [3] loss of style information

Given that that PDF at [2] is correct but incorrect at [3], it is the export at [1] to ODT that is causing the issues.

UserFieldStyleTest4.zip (82.1 KB)

@unb
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-25654

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.