Class Preprocess

java.lang.Object
org.docx4j.convert.out.ConversionFeatures
org.docx4j.convert.out.common.Preprocess

public class Preprocess extends ConversionFeatures
This class manages the preprocessing functionality for the conversion.
It contains two methods that get called from the conversions:
  • process: does the preprocessing and returns an OpcPackage or a WordprocessingMLPackage
  • createSections: generates the sections depending on the selected features
  • Constructor Details

    • Preprocess

      public Preprocess()
  • Method Details

    • process

      public static OpcPackage process(OpcPackage opcPackage, Set<String> features) throws Docx4JException
      This method applies those features in the preprocessing, that may be used with an OpcPackage.
      Features processed:
      • PP_COMMON_DEEP_COPY
      Parameters:
      opcPackage - , the package that should be preprocessed
      features - , the selected features
      Returns:
      a preprocessed OpcPackage
      Throws:
      Docx4JException
    • createRelationshipTypes

      protected static Set<String> createRelationshipTypes(Set<String> features)
      Check what parts might be changed by the preprocessing, those parts need to be deep copied.
      Parameters:
      features - , the selected features
      Returns:
      the affected parts
    • process

      public static WordprocessingMLPackage process(WordprocessingMLPackage wmlPackage, Set<String> features) throws Docx4JException
      This method applies those features in the preprocessing, that may be used with an WordprocessingMLPackage. As the WordprocessingMLPackage is a OpcPackage it will call process(OpcPackage).
      Features processed include, for example:
      • PP_COMMON_MOVE_BOOKMARKS
      • PP_COMMON_MOVE_PAGEBREAK
      • PP_COMMON_CONTAINERIZATION
      • PP_COMMON_COMBINE_FIELDS
      • PP_APACHEFOP_DISABLE_PAGEBREAK_FIRST_PARAGRAPH
      Parameters:
      wmlPackage - , the package that should be preprocessed
      features - , the selected features
      Returns:
      a preprocessed WordprocessingMLPackage
      Throws:
      Docx4JException