Class CanvasTag
This class represents a single tag on a single piece of marked content.
public class CanvasTag
- Inheritance
-
CanvasTag
- Derived
- Inherited Members
Remarks
This class represents a single tag on a single piece of marked content.
In Tagged PDF, a tag is the basic structure unit for marking content. The tag structure and hierarchy is largely comparable to HTML. As in HTML, every tag type has a name, defined here in therole
attribute. The tagging
mechanism in Tagged PDF is extensible, so PDF creators can choose to create
custom tags.
Constructors
CanvasTag(PdfName)
Creates a tag that is referenced to the document's tag structure (i.e. logical structure).
public CanvasTag(PdfName role)
Parameters
role
PdfNamethe type of tag
CanvasTag(PdfName, int)
Creates a tag that is referenced to the document's tag structure (i.e. logical structure).
public CanvasTag(PdfName role, int mcid)
Parameters
role
PdfNamethe type of tag
mcid
intmarked content id which serves as a reference to the document's logical structure
CanvasTag(PdfMcr)
Creates a tag that is referenced to the document's tag structure (i.e. logical structure).
public CanvasTag(PdfMcr mcr)
Parameters
mcr
PdfMcrthe Marked Content Reference wrapper object
Fields
properties
The properties of the tag.
protected PdfDictionary properties
Field Value
role
The type of the tag.
protected PdfName role
Field Value
Methods
AddProperty(PdfName, PdfObject)
Adds a single property to the tag 's properties.
public virtual CanvasTag AddProperty(PdfName name, PdfObject value)
Parameters
Returns
GetActualText()
Gets value of /ActualText property.
public virtual string GetActualText()
Returns
GetExpansionText()
public virtual string GetExpansionText()
Returns
GetMcid()
Get the marked content id of the tag.
public virtual int GetMcid()
Returns
- int
marked content id
GetProperties()
Get the properties of the tag.
public virtual PdfDictionary GetProperties()
Returns
- PdfDictionary
properties of the tag
GetProperty(PdfName)
Gets a property from the tag 's properties dictionary.
public virtual PdfObject GetProperty(PdfName name)
Parameters
name
PdfNamethe key of the key-value pair to be retrieved
Returns
- PdfObject
the value corresponding to the key
GetRole()
Get the role of the tag.
public virtual PdfName GetRole()
Returns
- PdfName
the role of the tag as a PdfName
HasMcid()
Determine if an MCID is available
public virtual bool HasMcid()
Returns
- bool
true if the MCID is available, false otherwise
RemoveProperty(PdfName)
Removes a single property from the tag 's properties.
public virtual CanvasTag RemoveProperty(PdfName name)
Parameters
name
PdfNamethe key of the key-value pair to be removed
Returns
SetProperties(PdfDictionary)
Sets a dictionary of properties to the tag 's properties.
public virtual CanvasTag SetProperties(PdfDictionary properties)
Parameters
properties
PdfDictionarya dictionary
Returns
Remarks
Sets a dictionary of properties to the tag 's properties. All existing properties (if any) will be lost.