Package com.itextpdf.kernel.pdf.tagutils
Class TagReference
- java.lang.Object
-
- com.itextpdf.kernel.pdf.tagutils.TagReference
-
public class TagReference extends java.lang.Object
The class is used to provide connection between structure element of Tagged PDF document and marked content sequence in PDF stream.See
TagTreePointer.getTagReference(int)
andPdfCanvas.openTag(TagReference)
.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
insertIndex
protected PdfDictionary
properties
protected PdfStructElem
referencedTag
protected PdfName
role
protected TagTreePointer
tagPointer
-
Constructor Summary
Constructors Modifier Constructor Description protected
TagReference(PdfStructElem referencedTag, TagTreePointer tagPointer, int insertIndex)
Creates aTagReference
instance which represents a reference toPdfStructElem
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TagReference
addProperty(PdfName name, PdfObject value)
Adds property, which will be associated with marked-content sequence.int
createNextMcid()
Creates next marked content identifier, which will be used to mark content in PDF stream.PdfDictionary
getProperties()
Gets properties, which will be associated with marked-content sequence asPdfDictionary
.PdfObject
getProperty(PdfName name)
Gets property which related to specified name.PdfName
getRole()
Gets role of structure element.TagReference
removeProperty(PdfName name)
Removes property.
-
-
-
Field Detail
-
tagPointer
protected TagTreePointer tagPointer
-
insertIndex
protected int insertIndex
-
referencedTag
protected PdfStructElem referencedTag
-
role
protected PdfName role
-
properties
protected PdfDictionary properties
-
-
Constructor Detail
-
TagReference
protected TagReference(PdfStructElem referencedTag, TagTreePointer tagPointer, int insertIndex)
Creates aTagReference
instance which represents a reference toPdfStructElem
.- Parameters:
referencedTag
- a structure element to which marked content will link (if insertIndex is -1, otherwise to MC will link to kid with insertIndex of passed structure element)tagPointer
- the tag pointer to structure elementinsertIndex
- if insertIndex is -1, the referencedTag will be used as a source of reference, otherwise the kid will be used
-
-
Method Detail
-
getRole
public PdfName getRole()
Gets role of structure element.- Returns:
- the role of structure element
-
createNextMcid
public int createNextMcid()
Creates next marked content identifier, which will be used to mark content in PDF stream.- Returns:
- the marked content identifier
-
addProperty
public TagReference addProperty(PdfName name, PdfObject value)
Adds property, which will be associated with marked-content sequence.- Parameters:
name
- the name of the propertyvalue
- the value of the property- Returns:
- the
TagReference
instance
-
removeProperty
public TagReference removeProperty(PdfName name)
Removes property. The property will not be associated with marked-content sequence.- Parameters:
name
- the name of property to be deleted- Returns:
- the
TagReference
instance
-
getProperty
public PdfObject getProperty(PdfName name)
Gets property which related to specified name.- Parameters:
name
- the name of the property- Returns:
- the value of the property
-
getProperties
public PdfDictionary getProperties()
Gets properties, which will be associated with marked-content sequence asPdfDictionary
.- Returns:
- the properties
-
-