Package org.docx4j.convert.out
Class ConversionFeatures
java.lang.Object
org.docx4j.convert.out.ConversionFeatures
- Direct Known Subclasses:
CreateWrappers,Preprocess
public abstract class ConversionFeatures
extends java.lang.Object
This interface contains flags that get passed to the conversion process.
- PP_xx : Functions that get done in the preprocessing step
- xx_COMMON_xx: Common functions, may be applied to HTML and PDF conversion.
- xx_HTML_xx: HTML functions, may be applied only to HTML conversion.
- xx_PDF_xx: PDF functions, may be applied only to PDF conversion.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]DEFAULT_HTML_FEATURESDefault features, that get applied to a HTML conversionstatic java.lang.String[]DEFAULT_PDF_FEATURESDefault features, that get applied to a PDF conversionstatic java.lang.StringPP_COMMON_COMBINE_FIELDSWord may save a field (date, page numbers, references...) in two formats: a simple one and a complex one.static java.lang.StringPP_COMMON_CONTAINERIZATIONWord combines the borders and background colors of two (or more) continuous paragraphs.static java.lang.StringPP_COMMON_CREATE_SECTIONSIn PDF the conversion process needs to break up the document into the defined sections to handle such things as headers and footers.static java.lang.StringPP_COMMON_DEEP_COPYDuring the conversion the document might be changed.static java.lang.StringPP_COMMON_DUMMY_CREATE_SECTIONSThis step defines only one section for the complete document.static java.lang.StringPP_COMMON_DUMMY_PAGE_NUMBERINGThis step defines some dummy page number information.static java.lang.StringPP_COMMON_MOVE_BOOKMARKSThe conversion is only able to handle bookmarks that are in a paragraph.static java.lang.StringPP_COMMON_MOVE_PAGEBREAKWord might put some pagebreaks in a paragraph.static java.lang.StringPP_COMMON_PAGE_NUMBERINGThe page number formatting might be stored in different places, the section properties and the field definition.static java.lang.StringPP_COMMON_TABLE_PARAGRAPH_STYLE_FIXIn a cell, a paragraph uses the table's paragraph properties, plus the relevant paragraph style (Normal, by default).static java.lang.StringPP_HTML_COLLECT_LISTSIn HTML the conversion process can create lists (OL, UL).static java.lang.StringPP_PDF_APACHEFOP_DISABLE_PAGEBREAK_FIRST_PARAGRAPHThis step removes a pagebreak before the first paragraph of the document.static java.lang.StringPP_PDF_APACHEFOP_DISABLE_PAGEBREAK_LIST_ITEMThis step removes a pagebreak before the first list item in each list.static java.lang.StringPP_PDF_COVERPAGE_MOVE_SECTPRIf the docx contains a cover page which starts with a sectPr, this step moves the sectPr to a new w:p inserted after. -
Constructor Summary
Constructors Constructor Description ConversionFeatures() -
Method Summary
Modifier and Type Method Description protected static voidcheckParams(OpcPackage opcPackage, java.util.Set<java.lang.String> features)Check the package and requested features and append defaults if necessary
-
Field Details
-
PP_COMMON_DEEP_COPY
public static final java.lang.String PP_COMMON_DEEP_COPYDuring the conversion the document might be changed. If the caller continues to use the document after it, a deep copy should be done. This is not needed if the document gets discarded after the conversion process.- See Also:
- Constant Field Values
-
PP_COMMON_MOVE_BOOKMARKS
public static final java.lang.String PP_COMMON_MOVE_BOOKMARKSThe conversion is only able to handle bookmarks that are in a paragraph. This flag that bookmarks are in paragraphs. This is not needed if the document doesn't contain bookmarks or page references.- See Also:
- Constant Field Values
-
PP_COMMON_MOVE_PAGEBREAK
public static final java.lang.String PP_COMMON_MOVE_PAGEBREAKWord might put some pagebreaks in a paragraph. In the conversion process the pagebreaks need to be at the beginning of a paragraph. This is not needed if the document doesn't contain explicit pagebreaks.- See Also:
- Constant Field Values
-
PP_COMMON_CONTAINERIZATION
public static final java.lang.String PP_COMMON_CONTAINERIZATIONWord combines the borders and background colors of two (or more) continuous paragraphs. This flag simulates this behaviour. This is not needed if paragraphs dont have a border or background color defined.- See Also:
- Constant Field Values
-
PP_COMMON_COMBINE_FIELDS
public static final java.lang.String PP_COMMON_COMBINE_FIELDSWord may save a field (date, page numbers, references...) in two formats: a simple one and a complex one. The conversion process only knows about the simple ones. This step converts the complex fields (if possible) to simple ones. This step is only required if the document contains page references.- See Also:
- Constant Field Values
-
PP_COMMON_PAGE_NUMBERING
public static final java.lang.String PP_COMMON_PAGE_NUMBERINGThe page number formatting might be stored in different places, the section properties and the field definition. If the document contains page count fields (NUMPAGES, SECTIONPAGES) it might be necessary to do a two pass conversion. This step collects the necessary information. A two pass conversion will only be done in PDF. This step isn't necessary if no page numbers are used or no custom formatting has been applied to the page number field and if no page count fields got used.
If this step is omitted thenPP_COMMON_DUMMY_PAGE_NUMBERINGwill be used.- See Also:
- Constant Field Values
-
PP_COMMON_DUMMY_PAGE_NUMBERING
public static final java.lang.String PP_COMMON_DUMMY_PAGE_NUMBERINGThis step defines some dummy page number information. The required data will be taken only from the section properties. In PDF the conversion will always be one pass. The use ofPP_COMMON_PAGE_NUMBERINGin HTML doesn't offer any advantage.- See Also:
- Constant Field Values
-
PP_COMMON_CREATE_SECTIONS
public static final java.lang.String PP_COMMON_CREATE_SECTIONSIn PDF the conversion process needs to break up the document into the defined sections to handle such things as headers and footers. This step does this processing. If the document only contains one section this processing isn't necessary. In the conversion to HTML the document will be treated as if it only has one section, therefore this step isn't needed in HTML.
If this step is omitted thenPP_COMMON_DUMMY_CREATE_SECTIONSwill be used.- See Also:
- Constant Field Values
-
PP_HTML_COLLECT_LISTS
public static final java.lang.String PP_HTML_COLLECT_LISTSIn HTML the conversion process can create lists (OL, UL). This step prepares for that, by inserting content controls around list items.- See Also:
- Constant Field Values
-
PP_COMMON_DUMMY_CREATE_SECTIONS
public static final java.lang.String PP_COMMON_DUMMY_CREATE_SECTIONSThis step defines only one section for the complete document. The required data will be taken from the body section pointers. In PDF the document will be treated as having only one section. The use ofPP_COMMON_CREATE_SECTIONSin HTML doesn't offer any advantage.- See Also:
- Constant Field Values
-
PP_PDF_APACHEFOP_DISABLE_PAGEBREAK_FIRST_PARAGRAPH
public static final java.lang.String PP_PDF_APACHEFOP_DISABLE_PAGEBREAK_FIRST_PARAGRAPHThis step removes a pagebreak before the first paragraph of the document. This is a workaround for https://issues.apache.org/bugzilla/show_bug.cgi?id=54094 You can disable this step if you are using FOP post 1.1 or another FO renderer.- See Also:
- Constant Field Values
-
PP_PDF_APACHEFOP_DISABLE_PAGEBREAK_LIST_ITEM
public static final java.lang.String PP_PDF_APACHEFOP_DISABLE_PAGEBREAK_LIST_ITEMThis step removes a pagebreak before the first list item in each list. This is a workaround for https://issues.apache.org/bugzilla/show_bug.cgi?id=54094 You can disable this step if you are using FOP post 1.1 or another FO renderer.- Since:
- 3.0.1
- See Also:
- Constant Field Values
-
PP_PDF_COVERPAGE_MOVE_SECTPR
public static final java.lang.String PP_PDF_COVERPAGE_MOVE_SECTPRIf the docx contains a cover page which starts with a sectPr, this step moves the sectPr to a new w:p inserted after. This prevents the generation of an empty fo:flow.- Since:
- 3.0.1
- See Also:
- Constant Field Values
-
PP_COMMON_TABLE_PARAGRAPH_STYLE_FIX
public static final java.lang.String PP_COMMON_TABLE_PARAGRAPH_STYLE_FIXIn a cell, a paragraph uses the table's paragraph properties, plus the relevant paragraph style (Normal, by default). The relevant paragraph style trumps the values from the table's paragraph properties, so that would mean giving the doc defaults (which we've made part of our styles) priority over the table's paragraph properties, which is wrong. TO avoid this, this preprocessor creates a new style, which encapsulates the paragraph style, with DocDefaults given lower priority than table style. This created style has no w:basedOn setting. This preprocessor is required if paragraphs in tables are being styled incorrectly. It wouldn't be required but for our DocDefaults styles hack!- Since:
- 3.0.2
- See Also:
- Constant Field Values
-
DEFAULT_PDF_FEATURES
public static final java.lang.String[] DEFAULT_PDF_FEATURESDefault features, that get applied to a PDF conversion -
DEFAULT_HTML_FEATURES
public static final java.lang.String[] DEFAULT_HTML_FEATURESDefault features, that get applied to a HTML conversion
-
-
Constructor Details
-
ConversionFeatures
public ConversionFeatures()
-
-
Method Details
-
checkParams
Check the package and requested features and append defaults if necessary- Parameters:
opcPackage-features-
-