Class FOSettings

java.lang.Object
org.docx4j.convert.out.AbstractConversionSettings
org.docx4j.convert.out.FOSettings

public class FOSettings
extends AbstractConversionSettings
This class contains the configuration for the conversion process.
The conversion is done in two steps:
  1. Generate a fo document
  2. Render it into the desired format
It should generally be configured on a per WordprocessingMLPackage basis.
  • Field Details

    • log

      protected static org.slf4j.Logger log
    • INTERNAL_FO_MIME

      public static final java.lang.String INTERNAL_FO_MIME
      There is no MIME that explicitly defines fo, only application/xml. If you want as the result of the conversion process the fo document then you should use the MIME defined here.
      See Also:
      Constant Field Values
    • MIME_PDF

      public static final java.lang.String MIME_PDF
      See Also:
      Constant Field Values
    • APACHEFOP_CONFIGURATION

      public static final java.lang.String APACHEFOP_CONFIGURATION
      See Also:
      Constant Field Values
    • APACHEFOP_MIME

      public static final java.lang.String APACHEFOP_MIME
      See Also:
      Constant Field Values
    • CUSTOM_FO_RENDERER

      public static final java.lang.String CUSTOM_FO_RENDERER
      See Also:
      Constant Field Values
    • FO_DUMP_FILE

      public static final java.lang.String FO_DUMP_FILE
      See Also:
      Constant Field Values
  • Constructor Details

  • Method Details

    • setFopConfig

      public void setFopConfig​(Fop fopConfig)
      Generally there is no need to invoke this; the fop config will be generated based on the fonts used in your WordprocessingMLPackage and the specified FontMapper. But in an advanced unsupported usage, you can specify your own Fop config. If its a String or InputStream, you'll need to unmarshall it.
      Parameters:
      fopConfig -
    • getFopConfig

      public Fop getFopConfig()
    • setOpcPackage

      public void setOpcPackage​(OpcPackage opcPackage) throws Docx4JException
      Side effect (where there is no fopConfig) for WordprocessingMLPackage is to invoke FopConfigUtil.createConfigurationObject
      Overrides:
      setOpcPackage in class AbstractConversionSettings
      Throws:
      Docx4JException
    • getApacheFopMime

      public java.lang.String getApacheFopMime()
    • setApacheFopMime

      public void setApacheFopMime​(java.lang.String apacheFopMime)
      The output format of the ApacheFORenderer. If no value is passed, then it will be a PDF document. If INTERNAL_FO_MIME is used then the fo document will be outputted to the OutputStream.
    • getCustomFoRenderer

      public FORenderer getCustomFoRenderer()
    • setCustomFoRenderer

      public void setCustomFoRenderer​(FORenderer customFoRenderer)
      If the rendering should be done with a different fo renderer, then you need to pass here your custom implementation of the FORenderer interface.
    • getFoDumpFile

      public java.io.File getFoDumpFile()
    • setFoDumpFile

      public void setFoDumpFile​(java.io.File foFile)
      For testing and debugging you can pass here a File object. The intermediate fo document will be outputted here. The outputted fo may contain placeholder for the 2 pass conversion.
    • lsLayoutMasterSetCalculationInProgress

      public boolean lsLayoutMasterSetCalculationInProgress()
    • setLayoutMasterSetCalculationInProgress

      public void setLayoutMasterSetCalculationInProgress​(boolean layoutMasterSetCalculationInProgress)
      The flag layoutMasterSetCalculationInProgress is used by LayoutMasterSetBuilder, to record whether for this conversion run, the correct extents have been calculated yet. User code should not alter this flag.