Class FOConversionContext


public class FOConversionContext extends AbstractWmlConversionContext
See /docs/developer/Convert_Out.docx for an overview of the design.
Author:
Alberto Zerolo
  • Field Details

    • requires2PassChecked

      protected boolean requires2PassChecked
    • requires2Pass

      protected boolean requires2Pass
    • foRenderer

      protected FORenderer foRenderer
    • FO_WRITER_REGISTRY

      protected static final AbstractWriterRegistry FO_WRITER_REGISTRY
    • FO_MESSAGE_WRITER

      protected static final AbstractMessageWriter FO_MESSAGE_WRITER
  • Constructor Details

  • Method Details

    • createRunFontSelector

      protected static RunFontSelector createRunFontSelector(WordprocessingMLPackage wmlPackage)
    • initializeFoRenderer

      protected FORenderer initializeFoRenderer(FOSettings settings)
    • initializeImageHandler

      protected ConversionImageHandler initializeImageHandler(AbstractConversionSettings settings, ConversionImageHandler handler)
      Overrides:
      initializeImageHandler in class AbstractConversionContext
    • getFORenderer

      public FORenderer getFORenderer()
    • forceRequires1Pass

      public void forceRequires1Pass()
      If it is a 2 pass generation, the xslfo document can't be generated independently of a rendering step. Some APIs return a xslfo document without rendering it (XSLFOExporterNonXSLT, Conversion.outputXSLFO), for this cases this method ensures, that the document doesn't require the corresponding parameters but if a 2 pass generation was required the rendered document will show errors.
    • isRequires2Pass

      public boolean isRequires2Pass()
    • checkRequires2Pass

      protected boolean checkRequires2Pass()
      A 2 pass pdf generation is required if the result of fo:page-number-citation-last does not correspond to the field results of NUMPAGES or SECTIONPAGES. This is the case when one of those fields are used and:
      • There is an explicit start of page numbers (> 1 in the first section, anything in the following sections) or
      • The document contains more than 1 section (and SECTIONPAGES is used).
      In theory, a different page number formatting of NUMPAGES or SECTIONPAGES should also trigger a 2 pass conversion. This case is ignored to have a consistent behavior with the page refs and reduce the amount of 2 passes.
      Returns: