Class FootnotesUtil

java.lang.Object
com.itextpdf.layout.properties.margins.FootnotesUtil

public final class FootnotesUtil extends Object
Utility class to process footnotes for internal usage only.
  • Method Details

    • addFootnotesToPage

      public static void addFootnotesToPage (int pageNum, Iterable<FootnoteRenderer> footnotesToAdd, PageMarginBoxes pageMarginBoxes, FootnotesProperties footnotesProperties)
      Adds provided footnotes to the specified page via PageMarginBoxes.
      Parameters:
      pageNum - page number
      footnotesToAdd - list of Footnote instance to add
      pageMarginBoxes - PageMarginBoxes for the page
      footnotesProperties - FootnotesProperties to 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 - FootnoteRenderer to set parent for
      documentRenderer - DocumentRenderer root renderer, the parent of footnotes container renderer
    • applyFootnoteAnchorStyle

      public static void applyFootnoteAnchorStyle (FootnoteAnchor anchor, Style footnoteAnchorLabelStyle)
      Applies Style storing style properties for footnote anchor that is placed inside the footnote.
      Parameters:
      anchor - FootnoteAnchor to apply style for
      footnoteAnchorLabelStyle - Style storing properties for footnote anchor inside the footnote
    • getInjectedFootnoteAnchor

      public static IElement getInjectedFootnoteAnchor (Footnote footnote)
      Gets injected footnote anchor element, which is a copy of a footnote anchor in the main content.
      Parameters:
      footnote - Footnote from which injected footnote anchor is retrieved
      Returns:
      injected footnote anchor element
    • isDefaultStyleNeededForInjectedFootnoteAnchor

      public static boolean isDefaultStyleNeededForInjectedFootnoteAnchor (Footnote footnote)
      Indicates whether a default style should be applied to injected footnote anchor copy.
      Parameters:
      footnote - Footnote containing injected anchor copy
      Returns:
      true if default style is needed, false otherwise
    • isDefaultStyleNeeded

      public static boolean isDefaultStyleNeeded (FootnoteAnchor anchor)
      Indicates whether a default style should be applied to the footnote anchor.
      Parameters:
      anchor - FootnoteAnchor to check
      Returns:
      true if default style is needed, false otherwise
    • createDefaultFootnoteAnchorStyle

      public static Style createDefaultFootnoteAnchorStyle (UnitValue parentFontSize)
      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 parentFontSize is null 12pt is used as the base size.

      Parameters:
      parentFontSize - parent font size unit value
      Returns:
      default style for a footnote anchor