com.lowagie.text.pdf

Class PdfStructureTreeRoot

public class PdfStructureTreeRoot extends PdfStructureBase

The structure tree root corresponds to the highest hierarchy level in a tagged PDF.

Author: Paulo Soares (psoares@consiste.pt)

Field Summary
intnextMark
MappageMCIDs
HashMapparentTree
PdfWriterwriter
Constructor Summary
PdfStructureTreeRoot(PdfWriter writer)
Method Summary
voidbuildTree()
intgetMCIDForPage(int pageIdx)
will NPE if pageIdx is unknown
IntegergetMCIDForPage(Integer pageIdx)
retrieves the existing MCID for a given page.
intgetNextMCID()
returns the next Marked Content ID.
PdfWritergetWriter()
Gets the writer.
voidmapRole(PdfName used, PdfName standard)
Maps the user tags to the standard tags.
voidnodeProcess(PdfDictionary struc, PdfIndirectReference reference)
voidsetObjMark(int objID, PdfIndirectReference strucRef)
Adds a structure element that is not part of a content item (annots & such)
intsetPageMark(int pageIdx, PdfIndirectReference struc)
Adds a marked content item to the given page.
voidsetPagesMCID(int pageIdx, int pageMCID)
Sets the page's MCID.

Field Detail

nextMark

private int nextMark

pageMCIDs

private Map pageMCIDs

parentTree

private HashMap parentTree

writer

private PdfWriter writer

Constructor Detail

PdfStructureTreeRoot

PdfStructureTreeRoot(PdfWriter writer)

Parameters: writer a VALID PdfWriter. Or else.

Method Detail

buildTree

void buildTree()

getMCIDForPage

public int getMCIDForPage(int pageIdx)
will NPE if pageIdx is unknown

Parameters: pageIdx

Returns: the MCID for the given page

Since: 2.1.5

getMCIDForPage

public Integer getMCIDForPage(Integer pageIdx)
retrieves the existing MCID for a given page.

Parameters: pageIdx

Returns: the MCID for the given page

Since: 2.1.5

getNextMCID

public int getNextMCID()
returns the next Marked Content ID.

Returns: the next top-level MCID

Since: 2.1.5

getWriter

public PdfWriter getWriter()
Gets the writer.

Returns: You'll never guess.

Since: 2.1.5

mapRole

public void mapRole(PdfName used, PdfName standard)
Maps the user tags to the standard tags. The mapping will allow a standard application to make some sense of the tagged document whatever the user tags may be.

Parameters: used the user tag standard the standard tag

nodeProcess

private void nodeProcess(PdfDictionary struc, PdfIndirectReference reference)

setObjMark

public void setObjMark(int objID, PdfIndirectReference strucRef)
Adds a structure element that is not part of a content item (annots & such)

Parameters: objID strucRef

Since: 2.1.5

setPageMark

public int setPageMark(int pageIdx, PdfIndirectReference struc)
Adds a marked content item to the given page. It returns the index into that page's marked content array... the MCID (which isn't a unique ID, and has no bearing on reading order)

Parameters: pageIdx durh struc An indirect reference to the *structure element*

Returns: MCID (aka index) for the referenced StructureElement

Since: 2.1.5

setPagesMCID

public void setPagesMCID(int pageIdx, int pageMCID)
Sets the page's MCID. "Pages" in the name is possessive, not plural.

Parameters: pageIdx That page thing we were just talking about. pageMCID The MCID for the page... Do try and keep up.

Since: 2.1.5