iText 8.0.2 API
iText.Kernel.Pdf.Canvas.CanvasTag Class Reference

This class represents a single tag on a single piece of marked content. More...

Inheritance diagram for iText.Kernel.Pdf.Canvas.CanvasTag:
iText.Kernel.Pdf.Canvas.CanvasArtifact

Public Member Functions

  CanvasTag (PdfName role)
  Creates a tag that is referenced to the document's tag structure (i.e. logical structure). More...
 
  CanvasTag (PdfName role, int mcid)
  Creates a tag that is referenced to the document's tag structure (i.e. logical structure). More...
 
  CanvasTag (PdfMcr mcr)
  Creates a tag that is referenced to the document's tag structure (i.e. logical structure). More...
 
virtual PdfName  GetRole ()
  Get the role of the tag. More...
 
virtual int  GetMcid ()
  Get the marked content id of the tag. More...
 
virtual bool  HasMcid ()
  Determine if an MCID is available More...
 
virtual iText.Kernel.Pdf.Canvas.CanvasTag  SetProperties (PdfDictionary properties)
  Sets a dictionary of properties to the tag 's properties. More...
 
virtual iText.Kernel.Pdf.Canvas.CanvasTag  AddProperty (PdfName name, PdfObject value)
  Adds a single property to the tag 's properties. More...
 
virtual iText.Kernel.Pdf.Canvas.CanvasTag  RemoveProperty (PdfName name)
  Removes a single property from the tag 's properties. More...
 
virtual PdfObject  GetProperty (PdfName name)
  Gets a property from the tag 's properties dictionary. More...
 
virtual PdfDictionary  GetProperties ()
  Get the properties of the tag. More...
 
virtual String  GetActualText ()
  Gets value of /ActualText property. More...
 
virtual String  GetExpansionText ()
 

Detailed Description

This class represents a single tag on a single piece of marked content.

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 the role attribute. The tagging mechanism in Tagged PDF is extensible, so PDF creators can choose to create custom tags.

Constructor & Destructor Documentation

◆ CanvasTag() [1/3]

iText.Kernel.Pdf.Canvas.CanvasTag.CanvasTag ( PdfName  role )
inline

Creates a tag that is referenced to the document's tag structure (i.e. logical structure).

Parameters
role the type of tag

◆ CanvasTag() [2/3]

iText.Kernel.Pdf.Canvas.CanvasTag.CanvasTag ( PdfName  role,
int  mcid 
)
inline

Creates a tag that is referenced to the document's tag structure (i.e. logical structure).

Parameters
role the type of tag
mcid marked content id which serves as a reference to the document's logical structure

◆ CanvasTag() [3/3]

iText.Kernel.Pdf.Canvas.CanvasTag.CanvasTag ( PdfMcr  mcr )
inline

Creates a tag that is referenced to the document's tag structure (i.e. logical structure).

Parameters
mcr the Marked Content Reference wrapper object

Member Function Documentation

◆ AddProperty()

virtual iText.Kernel.Pdf.Canvas.CanvasTag iText.Kernel.Pdf.Canvas.CanvasTag.AddProperty ( PdfName  name,
PdfObject  value 
)
inlinevirtual

Adds a single property to the tag 's properties.

Parameters
name a key
value the value for the key
Returns
current CanvasTag

◆ GetActualText()

virtual String iText.Kernel.Pdf.Canvas.CanvasTag.GetActualText ( )
inlinevirtual

Gets value of /ActualText property.

Returns
actual text value or null if actual text is not defined

◆ GetMcid()

virtual int iText.Kernel.Pdf.Canvas.CanvasTag.GetMcid ( )
inlinevirtual

Get the marked content id of the tag.

Returns
marked content id

◆ GetProperties()

virtual PdfDictionary iText.Kernel.Pdf.Canvas.CanvasTag.GetProperties ( )
inlinevirtual

Get the properties of the tag.

Returns
properties of the tag

◆ GetProperty()

virtual PdfObject iText.Kernel.Pdf.Canvas.CanvasTag.GetProperty ( PdfName  name )
inlinevirtual

Gets a property from the tag 's properties dictionary.

Parameters
name the key of the key-value pair to be retrieved
Returns
the value corresponding to the key

◆ GetRole()

virtual PdfName iText.Kernel.Pdf.Canvas.CanvasTag.GetRole ( )
inlinevirtual

Get the role of the tag.

Returns
the role of the tag as a PdfName

◆ HasMcid()

virtual bool iText.Kernel.Pdf.Canvas.CanvasTag.HasMcid ( )
inlinevirtual

Determine if an MCID is available

Returns
true if the MCID is available, false otherwise

◆ RemoveProperty()

virtual iText.Kernel.Pdf.Canvas.CanvasTag iText.Kernel.Pdf.Canvas.CanvasTag.RemoveProperty ( PdfName  name )
inlinevirtual

Removes a single property from the tag 's properties.

Parameters
name the key of the key-value pair to be removed
Returns
current CanvasTag

◆ SetProperties()

virtual iText.Kernel.Pdf.Canvas.CanvasTag iText.Kernel.Pdf.Canvas.CanvasTag.SetProperties ( PdfDictionary  properties )
inlinevirtual

Sets a dictionary of properties to the tag 's properties.

Sets a dictionary of properties to the tag 's properties. All existing properties (if any) will be lost.

Parameters
properties a dictionary
Returns
current CanvasTag