Package org.docx4j

Class Docx4J

java.lang.Object
org.docx4j.Docx4J

public class Docx4J extends Object
This is a facade for some typical uses of Docx4J:
  • Loading a document
  • Saving a document
  • Binding xml to content controls in a document
  • Exporting the document (to HTML, or PDF and other formats supported by the FO renderer)
  • Field Details

    • MIME_PDF

      public static final String MIME_PDF
      See Also:
    • MIME_FO

      public static final String MIME_FO
      See Also:
    • FLAG_NONE

      public static final int FLAG_NONE
      No flags passed, do the default
      See Also:
    • FLAG_EXPORT_PREFER_XSL

      public static final int FLAG_EXPORT_PREFER_XSL
      If available export the document using a xsl transformation
      See Also:
    • FLAG_EXPORT_PREFER_NONXSL

      public static final int FLAG_EXPORT_PREFER_NONXSL
      If available export the document using a visitor
      See Also:
    • FLAG_SAVE_ZIP_FILE

      public static final int FLAG_SAVE_ZIP_FILE
      Save the document in a zip container (default docx)
      See Also:
    • FLAG_SAVE_FLAT_XML

      public static final int FLAG_SAVE_FLAT_XML
      Save the document as a flat xml document
      See Also:
    • FLAG_SAVE_ENCRYPTED_BINARYRC4

      public static final int FLAG_SAVE_ENCRYPTED_BINARYRC4
      RC4 is weak, so don't use it unless you have to for backwards compatibility purposes (ie the applications to be used for reading your docx don't support anything better). See further http://blogs.msdn.com/b/david_leblanc/archive/2010/04/16/don-t-use-office-rc4-encryption-really-just-don-t-do-it.aspx
      See Also:
    • FLAG_SAVE_ENCRYPTED_STANDARD

      public static final int FLAG_SAVE_ENCRYPTED_STANDARD
      Standard encryption: This approach uses a binary EncryptionInfo structure. It uses Advanced Encryption Standard (AES) as an encryption algorithm and SHA-1 as a hashing algorithm.
      See Also:
    • FLAG_SAVE_ENCRYPTED_AGILE

      public static final int FLAG_SAVE_ENCRYPTED_AGILE
      Agile encryption: This is used by Word 2010, it uses an XML EncryptionInfo structure. The encryption and hashing algorithms are specified in the structure and can be for any encryption supported on the host computer.
      See Also:
    • FLAG_BIND_INSERT_XML

      public static final int FLAG_BIND_INSERT_XML
      inject the passed xml into the document if you don't do this step, then the xml in the document will be used.
      See Also:
    • FLAG_BIND_BIND_XML

      public static final int FLAG_BIND_BIND_XML
      Insert the data of the xml in the content controls Not needed, if the document will only be opened in Word and not converted to other formats.
      See Also:
    • FLAG_BIND_REMOVE_SDT

      public static final int FLAG_BIND_REMOVE_SDT
      Remove the content controls of the document
      See Also:
    • FLAG_BIND_REMOVE_XML

      public static final int FLAG_BIND_REMOVE_XML
      Remove any xml parts from the document that are used with the content controls.
      See Also:
    • NS_CONDITIONS

      protected static final String NS_CONDITIONS
      See Also:
    • NS_XPATHS

      protected static final String NS_XPATHS
      See Also:
    • NS_QUESTIONS

      protected static final String NS_QUESTIONS
      See Also:
    • NS_COMPONENTS

      protected static final String NS_COMPONENTS
      See Also:
    • PART_TO_REMOVE_SCHEMA_TYPES

      protected static final Set<String> PART_TO_REMOVE_SCHEMA_TYPES
    • EXPORT_FO_DETECTED

      public static Boolean EXPORT_FO_DETECTED
    • EXPORT_DOCUMENTS4J_REMOTE_DETECTED

      public static Boolean EXPORT_DOCUMENTS4J_REMOTE_DETECTED
    • EXPORT_DOCUMENTS4J_LOCAL_DETECTED

      public static Boolean EXPORT_DOCUMENTS4J_LOCAL_DETECTED
    • EXPORT_MICROSOFT_GRAPH_DETECTED

      public static Boolean EXPORT_MICROSOFT_GRAPH_DETECTED
    • EXPORT_LEGACY_CONVERTER_DETECTED

      public static Boolean EXPORT_LEGACY_CONVERTER_DETECTED
  • Constructor Details

    • Docx4J

      public Docx4J()
  • Method Details