Class PDFLogicalStructureHandler

java.lang.Object
org.apache.fop.render.pdf.PDFLogicalStructureHandler

public class PDFLogicalStructureHandler extends Object
Handles the creation of the logical structure in the PDF document.
  • Field Details

    • MCR

      private static final PDFName MCR
    • OBJR

      private static final PDFName OBJR
    • ARTIFACT

      private static final PDFLogicalStructureHandler.MarkedContentInfo ARTIFACT
    • pdfDoc

      private final PDFDocument pdfDoc
    • parentTree

      private final PDFParentTree parentTree
    • parentTreeKey

      private int parentTreeKey
    • currentPage

      private PDFPage currentPage
    • pageParentTreeArray

      private PDFArray pageParentTreeArray
      The array of references, from marked-content sequences in the current page, to their parent structure elements. This will be a value in the structure parent tree, whose corresponding key will be the page's StructParents entry.
  • Constructor Details

    • PDFLogicalStructureHandler

      PDFLogicalStructureHandler(PDFDocument pdfDoc)
      Creates a new instance for handling the logical structure of the given document.
      Parameters:
      pdfDoc - a document
  • Method Details

    • getPageParentTree

      public PDFArray getPageParentTree()
    • getParentTree

      public PDFParentTree getParentTree()
    • getNextParentTreeKey

      public int getNextParentTreeKey()
    • startPage

      void startPage(PDFPage page)
      Receive notification of the beginning of a new page.
      Parameters:
      page - the page that will be rendered in PDF
    • endPage

      void endPage()
      Receive notification of the end of the current page.
    • addToParentTree

      private PDFLogicalStructureHandler.MarkedContentInfo addToParentTree(PDFStructElem structureTreeElement)
    • addTextContentItem

      Adds a content item corresponding to text into the structure tree, if there is a structure element associated to it.
      Parameters:
      structElem - the parent structure element of the piece of text
      Returns:
      the necessary information for bracketing the content as a marked-content sequence. If there is no element in the structure tree associated to that content, returns an instance whose PDFLogicalStructureHandler.MarkedContentInfo.tag value is null. The content must then be treated as an artifact.
    • addImageContentItem

      Adds a content item corresponding to an image into the structure tree, if there is a structure element associated to it.
      Parameters:
      structElem - the parent structure element of the image
      Returns:
      the necessary information for bracketing the content as a marked-content sequence. If there is no element in the structure tree associated to that image, returns an instance whose PDFLogicalStructureHandler.MarkedContentInfo.tag value is null. The image must then be treated as an artifact.
    • addLinkContentItem

      void addLinkContentItem(PDFLink link, PDFStructElem structureTreeElement)
      Adds a content item corresponding to the given link into the structure tree.
      Parameters:
      link - a link
      structureTreeElement - its parent structure element