Package org.apache.fop.render.pdf
Class PDFLogicalStructureHandler
java.lang.Object
org.apache.fop.render.pdf.PDFLogicalStructureHandler
Handles the creation of the logical structure in the PDF document.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classClass providing the necessary information for bracketing content associated to a structure element as a marked-content sequence. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PDFLogicalStructureHandler.MarkedContentInfoprivate PDFPageprivate static final PDFNameprivate static final PDFNameprivate PDFArrayThe array of references, from marked-content sequences in the current page, to their parent structure elements.private final PDFParentTreeprivate intprivate final PDFDocument -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance for handling the logical structure of the given document. -
Method Summary
Modifier and TypeMethodDescription(package private) PDFLogicalStructureHandler.MarkedContentInfoaddImageContentItem(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) voidaddLinkContentItem(PDFLink link, PDFStructElem structureTreeElement) Adds a content item corresponding to the given link into the structure tree.(package private) PDFLogicalStructureHandler.MarkedContentInfoaddTextContentItem(PDFStructElem structElem) Adds a content item corresponding to text into the structure tree, if there is a structure element associated to it.addToParentTree(PDFStructElem structureTreeElement) (package private) voidendPage()Receive notification of the end of the current page.int(package private) voidReceive notification of the beginning of a new page.
-
Field Details
-
MCR
-
OBJR
-
ARTIFACT
-
pdfDoc
-
parentTree
-
parentTreeKey
private int parentTreeKey -
currentPage
-
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
-
getParentTree
-
getNextParentTreeKey
public int getNextParentTreeKey() -
startPage
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.tagvalue isnull. 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.tagvalue isnull. The image must then be treated as an artifact.
-
addLinkContentItem
Adds a content item corresponding to the given link into the structure tree.- Parameters:
link- a linkstructureTreeElement- its parent structure element
-