Package org.docx4j.convert.out.fo
Class XsltFOFunctions
java.lang.Object
org.docx4j.convert.out.fo.XsltFOFunctions
This class contains static functions that are specific to the FO xsl-transformation and
are called from docx2fo.xslt.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyFoAttributes(List<Property> properties, Element foElement) private static DocumentFragmentcreateBlock(FOConversionContext context, NodeIterator pPrNodeIt, String pStyleVal, NodeIterator childResults, boolean sdt) protected static DocumentFragmentcreateBlock(WordprocessingMLPackage wmlPackage, RunFontSelector runFontSelector, String pStyleVal, NodeIterator childResults, boolean sdt, PPr pPrDirect, PPr pPr, RPr rPr, RPr rPrParagraphMark) static DocumentFragmentcreateBlockForPPr(FOConversionContext context, NodeIterator pPrNodeIt, String pStyleVal, NodeIterator childResults) This is invoked on every paragraph, whether it has a pPr or not.static DocumentFragmentcreateBlockForRPr(FOConversionContext context, NodeIterator pPrNodeIt, NodeIterator rPrNodeIt, NodeIterator childResults) On a block representing a run, we just put run properties from this rPr node.static DocumentFragmentcreateBlockForSdt(FOConversionContext context, NodeIterator pPrNodeIt, String pStyleVal, NodeIterator childResults, String tag) private static voidcreateFoAttributes(OpcPackage opcPackage, PPr pPr, Element foBlockElement, boolean inList, boolean ignoreBorders) private static voidcreateFoAttributes(OpcPackage opcPackage, RPr rPr, Element foInlineElement) private static voidcreateFoAttributes(TcPr tcPr, Element foBlockElement) private static voidcreateFoAttributes(TrPr trPr, Element foBlockElement) static DocumentFragmentcreateInlineForSdt(FOConversionContext context, NodeIterator rPrNodeIt, NodeIterator childResults, String tag) protected static booleancreateListBlock(WordprocessingMLPackage wmlPackage, RunFontSelector runFontSelector, String pStyleVal, PPr pPrDirect, PPr pPr, RPr rPr, RPr rPrParagraphMark, Document document, Element foBlockElement, Element foListBlock) private static booleanfoContainsElement(Node sourceNode, String elementName) Recurse sourceNode looking to see whether it contains element with local name elementNameprotected static intgetDistanceToNextTabStop(int pos, int numWidth, Tabs pprTabs, DocumentSettingsPart settings) static StringgetForcePageCount(FOConversionContext context) FOP inserts a blank page if necessary so that a section with page numbering from 1 would be face up when printed double sided.static DocumentFragmentstatic StringgetPageNumberFormat(FOConversionContext context) static StringgetPageNumberInitial(FOConversionContext context) static booleanhasPgNumTypeStart(FOConversionContext context) private static booleanprotected static voidsetFont(RunFontSelector runFontSelector, Element foListItemLabelBody, PPr pPr, RPr rPr, String text) Use RunFontSelector to determine the correct font for the list item label.
-
Field Details
-
log
private static org.slf4j.Logger log
-
-
Constructor Details
-
XsltFOFunctions
public XsltFOFunctions()
-
-
Method Details
-
getLayoutMasterSetFragment
-
createBlockForSdt
public static DocumentFragment createBlockForSdt(FOConversionContext context, NodeIterator pPrNodeIt, String pStyleVal, NodeIterator childResults, String tag) -
createInlineForSdt
public static DocumentFragment createInlineForSdt(FOConversionContext context, NodeIterator rPrNodeIt, NodeIterator childResults, String tag) -
createBlockForPPr
public static DocumentFragment createBlockForPPr(FOConversionContext context, NodeIterator pPrNodeIt, String pStyleVal, NodeIterator childResults) This is invoked on every paragraph, whether it has a pPr or not.- Parameters:
wmlPackage-pPrNodeIt-pStyleVal-childResults- - the already transformed contents of the paragraph.- Returns:
-
foContainsElement
Recurse sourceNode looking to see whether it contains element with local name elementName- Parameters:
sourceNode-elementName-- Returns:
-
createBlock
private static DocumentFragment createBlock(FOConversionContext context, NodeIterator pPrNodeIt, String pStyleVal, NodeIterator childResults, boolean sdt) -
createBlock
protected static DocumentFragment createBlock(WordprocessingMLPackage wmlPackage, RunFontSelector runFontSelector, String pStyleVal, NodeIterator childResults, boolean sdt, PPr pPrDirect, PPr pPr, RPr rPr, RPr rPrParagraphMark) -
createListBlock
protected static boolean createListBlock(WordprocessingMLPackage wmlPackage, RunFontSelector runFontSelector, String pStyleVal, PPr pPrDirect, PPr pPr, RPr rPr, RPr rPrParagraphMark, Document document, Element foBlockElement, Element foListBlock) -
setFont
protected static void setFont(RunFontSelector runFontSelector, Element foListItemLabelBody, PPr pPr, RPr rPr, String text) Use RunFontSelector to determine the correct font for the list item label.- Parameters:
context-foListItemLabelBody-pPr-rPr-text-
-
getDistanceToNextTabStop
protected static int getDistanceToNextTabStop(int pos, int numWidth, Tabs pprTabs, DocumentSettingsPart settings) -
createFoAttributes
private static void createFoAttributes(OpcPackage opcPackage, PPr pPr, Element foBlockElement, boolean inList, boolean ignoreBorders) -
applyFoAttributes
-
createFoAttributes
-
createFoAttributes
-
createBlockForRPr
public static DocumentFragment createBlockForRPr(FOConversionContext context, NodeIterator pPrNodeIt, NodeIterator rPrNodeIt, NodeIterator childResults) On a block representing a run, we just put run properties from this rPr node. The paragraph style rPr's have been taken care of on the fo block which represents the paragraph.- Parameters:
wmlPackage-rPrNodeIt-childResults-- Returns:
-
createFoAttributes
-
getPageNumberFormat
-
getPageNumberInitial
-
getForcePageCount
FOP inserts a blank page if necessary so that a section with page numbering from 1 would be face up when printed double sided. Word doesn't do that (unless you have an odd section type), so this function mimics Word's behaviour.- Parameters:
context-- Returns:
- Since:
- 3.2.2
-
isOdd
-
hasPgNumTypeStart
-