drmacro / wordinator

Generate high-quality DOCX files using a simplified XML format (simple word processing XML).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generated docx files are reported as in "compatibility mode"

drmacro opened this issue · comments

When these properties are not in the settings.xml:

  <w:compat>
    <w:compatSetting w:name="compatibilityMode" w:uri="http://schemas.microsoft.com/office/word"
      w:val="15"/>
    <w:compatSetting w:name="overrideTableStyleFontSizeAndJustification"
      w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
    <w:compatSetting w:name="enableOpenTypeFeatures"
      w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
    <w:compatSetting w:name="doNotFlipMirrorIndents"
      w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
    <w:compatSetting w:name="differentiateMultirowTableHeaders"
      w:uri="http://schemas.microsoft.com/office/word" w:val="1"/>
    <w:compatSetting w:name="useWord2013TrackBottomHyphenation"
      w:uri="http://schemas.microsoft.com/office/word" w:val="0"/>
  </w:compat>

Then when opened in Word, the doc is put into "compatibility" mode.

Looking at the code for XWPFSettings class, the underlying XML is held in a private member and so not accessible via the API.

It looks like POI 5.2.5 adds the ability to modify the settings.