Package org.apache.fop.render.pdf
Class PDFLogicalStructureHandler
- java.lang.Object
-
- org.apache.fop.render.pdf.PDFLogicalStructureHandler
-
public class PDFLogicalStructureHandler extends java.lang.Object
Handles the creation of the logical structure in the PDF document.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
PDFLogicalStructureHandler.MarkedContentInfo
Class providing the necessary information for bracketing content associated to a structure element as a marked-content sequence.
-
Field Summary
Fields Modifier and Type Field Description private static PDFLogicalStructureHandler.MarkedContentInfo
ARTIFACT
private PDFPage
currentPage
private static PDFName
MCR
private static PDFName
OBJR
private PDFArray
pageParentTreeArray
The array of references, from marked-content sequences in the current page, to their parent structure elements.private PDFParentTree
parentTree
private int
parentTreeKey
private PDFDocument
pdfDoc
-
Constructor Summary
Constructors Constructor Description PDFLogicalStructureHandler(PDFDocument pdfDoc)
Creates a new instance for handling the logical structure of the given document.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) PDFLogicalStructureHandler.MarkedContentInfo
addImageContentItem(PDFStructElem structElem)
Adds a content item corresponding to an image into the structure tree, if there is a structure element associated to it.(package private) void
addLinkContentItem(PDFLink link, PDFStructElem structureTreeElement)
Adds a content item corresponding to the given link into the structure tree.(package private) PDFLogicalStructureHandler.MarkedContentInfo
addTextContentItem(PDFStructElem structElem)
Adds a content item corresponding to text into the structure tree, if there is a structure element associated to it.private PDFLogicalStructureHandler.MarkedContentInfo
addToParentTree(PDFStructElem structureTreeElement)
(package private) void
endPage()
Receive notification of the end of the current page.int
getNextParentTreeKey()
PDFArray
getPageParentTree()
PDFParentTree
getParentTree()
(package private) void
startPage(PDFPage page)
Receive notification of the beginning of a new page.
-
-
-
Field Detail
-
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 Detail
-
PDFLogicalStructureHandler
PDFLogicalStructureHandler(PDFDocument pdfDoc)
Creates a new instance for handling the logical structure of the given document.- Parameters:
pdfDoc
- a document
-
-
Method Detail
-
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
PDFLogicalStructureHandler.MarkedContentInfo addTextContentItem(PDFStructElem structElem)
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 isnull
. The content must then be treated as an artifact.
-
addImageContentItem
PDFLogicalStructureHandler.MarkedContentInfo addImageContentItem(PDFStructElem structElem)
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 isnull
. 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 linkstructureTreeElement
- its parent structure element
-
-