Class FootnotesUtil
java.lang.Object
com.itextpdf.layout.properties.margins.FootnotesUtil
Utility class to process footnotes for internal usage only.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddFootnotesToPage(int pageNum, Iterable<FootnoteRenderer> footnotesToAdd, PageMarginBoxes pageMarginBoxes, FootnotesProperties footnotesProperties) Adds provided footnotes to the specified page viaPageMarginBoxes.static voidapplyFootnoteAnchorStyle(FootnoteAnchor anchor, Style footnoteAnchorLabelStyle) AppliesStylestoring style properties for footnote anchor that is placed inside the footnote.static StylecreateDefaultFootnoteAnchorStyle(UnitValue parentFontSize) Creates the default style for a footnote anchor in the main content.static IElementgetInjectedFootnoteAnchor(Footnote footnote) Gets injected footnote anchor element, which is a copy of a footnote anchor in the main content.static booleanisDefaultStyleNeeded(FootnoteAnchor anchor) Indicates whether a default style should be applied to the footnote anchor.static booleanIndicates whether a default style should be applied to injected footnote anchor copy.static voidsetParentForFootnoteRenderer(FootnoteRenderer footnoteRenderer, DocumentRenderer documentRenderer) Sets parent for footnote renderer in order for it to be layouted with correct properties and styles applied.
-
Method Details
-
addFootnotesToPage
public static void addFootnotesToPage(int pageNum, Iterable<FootnoteRenderer> footnotesToAdd, PageMarginBoxes pageMarginBoxes, FootnotesProperties footnotesProperties) Adds provided footnotes to the specified page viaPageMarginBoxes.- Parameters:
-
pageNum- page number -
footnotesToAdd- list ofFootnoteinstance to add -
pageMarginBoxes-PageMarginBoxesfor the page -
footnotesProperties-FootnotesPropertiesto apply for footnotes
-
setParentForFootnoteRenderer
public static void setParentForFootnoteRenderer(FootnoteRenderer footnoteRenderer, DocumentRenderer documentRenderer) Sets parent for footnote renderer in order for it to be layouted with correct properties and styles applied.- Parameters:
-
footnoteRenderer-FootnoteRendererto set parent for -
documentRenderer-DocumentRendererroot renderer, the parent of footnotes container renderer
-
applyFootnoteAnchorStyle
AppliesStylestoring style properties for footnote anchor that is placed inside the footnote.- Parameters:
-
anchor-FootnoteAnchorto apply style for -
footnoteAnchorLabelStyle-Stylestoring properties for footnote anchor inside the footnote
-
getInjectedFootnoteAnchor
Gets injected footnote anchor element, which is a copy of a footnote anchor in the main content.- Parameters:
-
footnote-Footnotefrom which injected footnote anchor is retrieved - Returns:
- injected footnote anchor element
-
isDefaultStyleNeededForInjectedFootnoteAnchor
Indicates whether a default style should be applied to injected footnote anchor copy.- Parameters:
-
footnote-Footnotecontaining injected anchor copy - Returns:
-
trueif default style is needed,falseotherwise
-
isDefaultStyleNeeded
Indicates whether a default style should be applied to the footnote anchor.- Parameters:
-
anchor-FootnoteAnchorto check - Returns:
-
trueif default style is needed,falseotherwise
-
createDefaultFootnoteAnchorStyle
Creates the default style for a footnote anchor in the main content.The resulting style uses a reduced font size and positive text rise relative to the parent font size:
font size = parent font size * 0.5
text rise = parent font size * 0.6
If
parentFontSizeisnull12ptis used as the base size.- Parameters:
-
parentFontSize- parent font size unit value - Returns:
- default style for a footnote anchor
-