iText 8.0.5 API
iText.Kernel.Pdf.Tagging.PdfStructElem Class Reference

A wrapper for structure element dictionaries (ISO-32000 14.7.2 "Structure Hierarchy"). More...

Inheritance diagram for iText.Kernel.Pdf.Tagging.PdfStructElem:
iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary > iText.Kernel.Pdf.Tagging.IStructureNode

Public Member Functions

  PdfStructElem (PdfDictionary pdfObject)
 
  PdfStructElem (PdfDocument document, PdfName role, PdfPage page)
 
  PdfStructElem (PdfDocument document, PdfName role, PdfAnnotation annot)
 
  PdfStructElem (PdfDocument document, PdfName role)
 
virtual PdfObject  GetAttributes (bool createNewIfNull)
  Gets attributes object. More...
 
virtual void  SetAttributes (PdfObject attributes)
 
virtual PdfString  GetLang ()
 
virtual void  SetLang (PdfString lang)
 
virtual PdfString  GetAlt ()
 
virtual void  SetAlt (PdfString alt)
 
virtual PdfString  GetActualText ()
 
virtual void  SetActualText (PdfString actualText)
 
virtual PdfString  GetE ()
 
virtual void  SetE (PdfString e)
 
virtual PdfString  GetStructureElementId ()
  Gets the structure element's ID string, if it has one. More...
 
virtual void  SetStructureElementId (PdfString id)
  Sets the structure element's ID string. More...
 
virtual PdfName  GetRole ()
 
virtual void  SetRole (PdfName role)
 
virtual iText.Kernel.Pdf.Tagging.PdfStructElem  AddKid (iText.Kernel.Pdf.Tagging.PdfStructElem kid)
 
virtual iText.Kernel.Pdf.Tagging.PdfStructElem  AddKid (int index, iText.Kernel.Pdf.Tagging.PdfStructElem kid)
 
virtual PdfMcr  AddKid (PdfMcr kid)
 
virtual PdfMcr  AddKid (int index, PdfMcr kid)
 
virtual IStructureNode  RemoveKid (int index)
 
virtual IStructureNode  RemoveKid (int index, bool prepareForReAdding)
 
virtual int  RemoveKid (IStructureNode kid)
 
virtual IStructureNode  GetParent ()
 
virtual IList< IStructureNode GetKids ()
  Gets list of the direct kids of structure element. More...
 
virtual PdfObject  GetK ()
 
virtual IList< iText.Kernel.Pdf.Tagging.PdfStructElem GetRefsList ()
  A iText.Kernel.Pdf.PdfName.Ref identifies the structure element or elements to which the item of content, contained within this structure element, refers (e.g. footnotes, endnotes, sidebars, etc.). More...
 
virtual void  AddRef (iText.Kernel.Pdf.Tagging.PdfStructElem @ref)
  A iText.Kernel.Pdf.PdfName.Ref identifies the structure element to which the item of content, contained within this structure element, refers (e.g. footnotes, endnotes, sidebars, etc.). More...
 
virtual PdfNamespace  GetNamespace ()
  A namespace this element belongs to (see ISO 32000-2 14.7.4, "Namespaces"). More...
 
virtual void  SetNamespace (PdfNamespace @namespace)
  A namespace this element belongs to (see ISO 32000-2 14.7.4, "Namespaces"). More...
 
virtual void  SetPhoneme (PdfString elementPhoneme)
  Attribute for a structure element that may be used as pronunciation hint. More...
 
virtual PdfString  GetPhoneme ()
  Attribute for a structure element that may be used as pronunciation hint. More...
 
virtual void  SetPhoneticAlphabet (PdfName phoneticAlphabet)
  Attribute for a structure element that indicates the phonetic alphabet used by a iText.Kernel.Pdf.PdfName.Phoneme attribute. More...
 
virtual PdfName  GetPhoneticAlphabet ()
  Attribute for a structure element that indicates the phonetic alphabet used by a iText.Kernel.Pdf.PdfName.Phoneme attribute. More...
 
virtual void  AddAssociatedFile (String description, PdfFileSpec fs)
  Adds file associated with structure element and identifies the relationship between them. More...
 
virtual void  AddAssociatedFile (PdfFileSpec fs)
 
virtual PdfArray  GetAssociatedFiles (bool create)
  Returns files associated with structure element. More...
 
virtual iText.Kernel.Pdf.Tagging.PdfStructElem  Put (PdfName key, PdfObject value)
 
override void  Flush ()
 
- Public Member Functions inherited from iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >
virtual T  GetPdfObject ()
 
virtual iText.Kernel.Pdf.PdfObjectWrapper< T >  MakeIndirect (PdfDocument document, PdfIndirectReference reference)
  Marks object behind wrapper to be saved as indirect. More...
 
virtual iText.Kernel.Pdf.PdfObjectWrapper< T >  MakeIndirect (PdfDocument document)
  Marks object behind wrapper to be saved as indirect. More...
 
virtual iText.Kernel.Pdf.PdfObjectWrapper< T >  SetModified ()
 
virtual bool  IsFlushed ()
 

Static Public Member Functions

static bool  IsStructElem (PdfDictionary dictionary)
  Method to distinguish struct elements from other elements of the logical tree (like mcr or struct tree root). More...
 

Package Functions

override bool  IsWrappedObjectMustBeIndirect ()
  Defines if the object behind this wrapper must be an indirect object in the resultant document. More...
 
virtual PdfDocument  GetDocument ()
 
- Package Functions inherited from iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >
  PdfObjectWrapper (T pdfObject)
 
virtual void  SetPdfObject (T pdfObject)
 
virtual void  SetForbidRelease ()
 
virtual void  UnsetForbidRelease ()
 
virtual void  EnsureUnderlyingObjectHasIndirectReference ()
 

Additional Inherited Members

- Static Package Functions inherited from iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >
static void  MarkObjectAsIndirect (PdfObject pdfObject)
 
static void  EnsureObjectIsAddedToDocument (PdfObject @object)
  Some wrappers use object's indirect reference to obtain the PdfDocument to which the object belongs to. More...
 

Detailed Description

A wrapper for structure element dictionaries (ISO-32000 14.7.2 "Structure Hierarchy").

A wrapper for structure element dictionaries (ISO-32000 14.7.2 "Structure Hierarchy").

The logical structure of a document shall be described by a hierarchy of objects called the structure hierarchy or structure tree. At the root of the hierarchy shall be a dictionary object called the structure tree root (see PdfStructTreeRoot ). Immediate children of the structure tree root are structure elements. Structure elements are other structure elements or content items.

Member Function Documentation

◆ AddAssociatedFile() [1/2]

virtual void iText.Kernel.Pdf.Tagging.PdfStructElem.AddAssociatedFile ( PdfFileSpec  fs )
inlinevirtual

Adds file associated with structure element and identifies the relationship between them.

Adds file associated with structure element and identifies the relationship between them.

Associated files may be used in Pdf/A-3 and Pdf 2.0 documents. The method adds file to array value of the AF key in the structure element dictionary.

For associated files their associated file specification dictionaries shall include the AFRelationship key

Parameters
fs file specification dictionary of associated file

◆ AddAssociatedFile() [2/2]

virtual void iText.Kernel.Pdf.Tagging.PdfStructElem.AddAssociatedFile ( String  description,
PdfFileSpec  fs 
)
inlinevirtual

Adds file associated with structure element and identifies the relationship between them.

Adds file associated with structure element and identifies the relationship between them.

Associated files may be used in Pdf/A-3 and Pdf 2.0 documents. The method adds file to array value of the AF key in the structure element dictionary. If description is provided, it also will add file description to catalog Names tree.

For associated files their associated file specification dictionaries shall include the AFRelationship key

Parameters
description the file description
fs file specification dictionary of associated file

◆ AddRef()

virtual void iText.Kernel.Pdf.Tagging.PdfStructElem.AddRef ( iText.Kernel.Pdf.Tagging.PdfStructElem ref )
inlinevirtual

A iText.Kernel.Pdf.PdfName.Ref identifies the structure element to which the item of content, contained within this structure element, refers (e.g. footnotes, endnotes, sidebars, etc.).

A iText.Kernel.Pdf.PdfName.Ref identifies the structure element to which the item of content, contained within this structure element, refers (e.g. footnotes, endnotes, sidebars, etc.).

This value has meaning only for the PDF documents of version 2.0 and higher.

Parameters
ref a PdfStructElem to which the item of content, contained within this structure element, refers.

◆ GetAssociatedFiles()

virtual PdfArray iText.Kernel.Pdf.Tagging.PdfStructElem.GetAssociatedFiles ( bool  create )
inlinevirtual

Returns files associated with structure element.

Parameters
create defines whether AF arrays will be created if it doesn't exist
Returns
associated files array

◆ GetAttributes()

virtual PdfObject iText.Kernel.Pdf.Tagging.PdfStructElem.GetAttributes ( bool  createNewIfNull )
inlinevirtual

Gets attributes object.

Parameters
createNewIfNull sometimes attributes object may not exist. Pass true if you want to create empty dictionary in such case. The attributes dictionary will be stored inside element.
Returns
attributes dictionary.

◆ GetKids()

virtual IList<IStructureNode> iText.Kernel.Pdf.Tagging.PdfStructElem.GetKids ( )
inlinevirtual

Gets list of the direct kids of structure element.

Gets list of the direct kids of structure element. If certain kid is flushed, there will be a null in the list on it's place.

Returns
list of the direct kids of structure element.

Implements iText.Kernel.Pdf.Tagging.IStructureNode.

◆ GetNamespace()

virtual PdfNamespace iText.Kernel.Pdf.Tagging.PdfStructElem.GetNamespace ( )
inlinevirtual

A namespace this element belongs to (see ISO 32000-2 14.7.4, "Namespaces").

A namespace this element belongs to (see ISO 32000-2 14.7.4, "Namespaces"). If not present, the element shall be considered to be in the default standard structure namespace.

Returns
a PdfNamespace this element belongs to.

◆ GetParent()

virtual IStructureNode iText.Kernel.Pdf.Tagging.PdfStructElem.GetParent ( )
inlinevirtual
Returns
parent of the current structure element. Returns null if parent isn't set or if either current element or parent are invalid.

Implements iText.Kernel.Pdf.Tagging.IStructureNode.

◆ GetPhoneme()

virtual PdfString iText.Kernel.Pdf.Tagging.PdfStructElem.GetPhoneme ( )
inlinevirtual

Attribute for a structure element that may be used as pronunciation hint.

Attribute for a structure element that may be used as pronunciation hint. It is an exact replacement for content enclosed by the structure element and its children.

Returns
a iText.Kernel.Pdf.PdfString which defines an exact replacement for content enclosed by the structure element and its children. This value is to be interpreted based on the PhoneticAlphabet attribute in effect.

◆ GetPhoneticAlphabet()

virtual PdfName iText.Kernel.Pdf.Tagging.PdfStructElem.GetPhoneticAlphabet ( )
inlinevirtual

Attribute for a structure element that indicates the phonetic alphabet used by a iText.Kernel.Pdf.PdfName.Phoneme attribute.

Attribute for a structure element that indicates the phonetic alphabet used by a iText.Kernel.Pdf.PdfName.Phoneme attribute. Applies to the structure element and its children, except where overridden by a child structure element.

Returns
the iText.Kernel.Pdf.PdfName which defines phonetic alphabet used by a iText.Kernel.Pdf.PdfName.Phoneme , or null if not defined, default value iText.Kernel.Pdf.PdfName.ipa . See SetPhoneticAlphabet(iText.Kernel.Pdf.PdfName) for other possible values.

◆ GetRefsList()

virtual IList<iText.Kernel.Pdf.Tagging.PdfStructElem> iText.Kernel.Pdf.Tagging.PdfStructElem.GetRefsList ( )
inlinevirtual

A iText.Kernel.Pdf.PdfName.Ref identifies the structure element or elements to which the item of content, contained within this structure element, refers (e.g. footnotes, endnotes, sidebars, etc.).

Returns
a System.Collections.IList < PdfStructElem > containing zero, one or more structure elements.

◆ GetStructureElementId()

virtual PdfString iText.Kernel.Pdf.Tagging.PdfStructElem.GetStructureElementId ( )
inlinevirtual

Gets the structure element's ID string, if it has one.

Returns
the structure element's ID string, or null if there is none

◆ IsStructElem()

static bool iText.Kernel.Pdf.Tagging.PdfStructElem.IsStructElem ( PdfDictionary  dictionary )
inlinestatic

Method to distinguish struct elements from other elements of the logical tree (like mcr or struct tree root).

Parameters
dictionary the iText.Kernel.Pdf.PdfDictionary to check on containing struct elements
Returns
if the type of iText.Kernel.Pdf.PdfDictionary is StructElem or iText.Kernel.Pdf.PdfDictionary contains the required key S then true, otherwise false

◆ IsWrappedObjectMustBeIndirect()

override bool iText.Kernel.Pdf.Tagging.PdfStructElem.IsWrappedObjectMustBeIndirect ( )
inlinepackagevirtual

Defines if the object behind this wrapper must be an indirect object in the resultant document.

Defines if the object behind this wrapper must be an indirect object in the resultant document.

If this method returns true it doesn't necessarily mean that object must be in the indirect state at any moment, but rather defines that when the object will be written to the document it will be transformed into indirect object if it's not indirect yet.

Return value of this method shouldn't depend on any logic, it should return always true or false.

Returns
true if in the resultant document the object behind the wrapper must be indirect, otherwise false.

Implements iText.Kernel.Pdf.PdfObjectWrapper< PdfDictionary >.

◆ SetNamespace()

virtual void iText.Kernel.Pdf.Tagging.PdfStructElem.SetNamespace ( PdfNamespace namespace )
inlinevirtual

A namespace this element belongs to (see ISO 32000-2 14.7.4, "Namespaces").

A namespace this element belongs to (see ISO 32000-2 14.7.4, "Namespaces").

This value has meaning only for the PDF documents of version 2.0 and higher.

Parameters
namespace a PdfNamespace this element belongs to, or null if element is desired to be considered in the default standard structure namespace.

◆ SetPhoneme()

virtual void iText.Kernel.Pdf.Tagging.PdfStructElem.SetPhoneme ( PdfString  elementPhoneme )
inlinevirtual

Attribute for a structure element that may be used as pronunciation hint.

Attribute for a structure element that may be used as pronunciation hint. It is an exact replacement for content enclosed by the structure element and its children.

This value has meaning only for the PDF documents of version 2.0 and higher.

Parameters
elementPhoneme a iText.Kernel.Pdf.PdfString which defines an exact replacement for content enclosed by the structure element and its children. This value is to be interpreted based on the PhoneticAlphabet attribute in effect.

◆ SetPhoneticAlphabet()

virtual void iText.Kernel.Pdf.Tagging.PdfStructElem.SetPhoneticAlphabet ( PdfName  phoneticAlphabet )
inlinevirtual

Attribute for a structure element that indicates the phonetic alphabet used by a iText.Kernel.Pdf.PdfName.Phoneme attribute.

Attribute for a structure element that indicates the phonetic alphabet used by a iText.Kernel.Pdf.PdfName.Phoneme attribute. Applies to the structure element and its children, except where overridden by a child structure element.

This value has meaning only for the PDF documents of version 2.0 and higher.

Parameters
phoneticAlphabet the iText.Kernel.Pdf.PdfName which defines phonetic alphabet used by a iText.Kernel.Pdf.PdfName.Phoneme attribute. Possible values are:
  • iText.Kernel.Pdf.PdfName.ipa for the International Phonetic Alphabet by the International Phonetic Association;
  • iText.Kernel.Pdf.PdfName.x_sampa for Extended Speech Assessment Methods Phonetic Alphabet (X-SAMPA);
  • iText.Kernel.Pdf.PdfName.zh_Latn_pinyin for Pinyin Latin romanization (Mandarin);
  • iText.Kernel.Pdf.PdfName.zh_Latn_wadegile for Wade-Giles romanization (Mandarin).
Other values may be used.

◆ SetStructureElementId()

virtual void iText.Kernel.Pdf.Tagging.PdfStructElem.SetStructureElementId ( PdfString  id )
inlinevirtual

Sets the structure element's ID string.

Sets the structure element's ID string. This value can be used by other structure elements to reference this one.

Parameters
id the element's ID string to be set