iText 8.0.4 API
iText.Kernel.Pdf.Tagging.PdfStructTreeRoot Class Reference

Represents a wrapper-class for structure tree root dictionary. More...

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

Public Member Functions

  PdfStructTreeRoot (PdfDocument document)
  Creates a new structure tree root instance, this initializes empty logical structure in the document. More...
 
  PdfStructTreeRoot (PdfDictionary structTreeRootDict, PdfDocument document)
  Creates wrapper instance for already existing logical structure tree root in the document. More...
 
virtual PdfStructElem  AddKid (PdfStructElem structElem)
 
virtual PdfStructElem  AddKid (int index, PdfStructElem structElem)
 
virtual IStructureNode  GetParent ()
 
virtual IList< IStructureNode GetKids ()
  Gets list of the direct kids of StructTreeRoot. More...
 
virtual PdfArray  GetKidsObject ()
 
virtual void  AddRoleMapping (String fromRole, String toRole)
 
virtual PdfDictionary  GetRoleMap ()
 
virtual IList< PdfNamespace GetNamespaces ()
  Gets namespaces used within the document. More...
 
virtual void  AddNamespace (PdfNamespace @namespace)
  Adds a PdfNamespace to the list of the namespaces used within the document. More...
 
virtual PdfArray  GetNamespacesObject ()
  An array of namespaces used within the document. More...
 
virtual IList< PdfFileSpec GetPronunciationLexiconsList ()
  A System.Collections.IList containing one or more iText.Kernel.Pdf.Filespec.PdfFileSpec objects, where each specified file is a pronunciation lexicon, which is an XML file conforming to the Pronunciation Lexicon Specification (PLS) Version 1.0. More...
 
virtual void  AddPronunciationLexicon (PdfFileSpec pronunciationLexiconFileSpec)
  Adds a single iText.Kernel.Pdf.Filespec.PdfFileSpec object, which specifies XML file conforming to PLS. More...
 
virtual void  CreateParentTreeEntryForPage (PdfPage page)
  Creates and flushes parent tree entry for the page. More...
 
virtual void  SavePageStructParentIndexIfNeeded (PdfPage page)
 
virtual ICollection< PdfMcr GetPageMarkedContentReferences (PdfPage page)
  Gets an unmodifiable collection of marked content references on page. More...
 
virtual PdfMcr  FindMcrByMcid (PdfDictionary pageDict, int mcid)
 
virtual PdfMcr  FindMcrByMcid (PdfDocument document, int mcid)
 
virtual PdfObjRef  FindObjRefByStructParentIndex (PdfDictionary pageDict, int structParentIndex)
 
virtual PdfName  GetRole ()
 
override void  Flush ()
 
virtual void  CopyTo (PdfDocument destDocument, IDictionary< PdfPage, PdfPage > page2page)
  Copies structure to a destDocument . More...
 
virtual void  CopyTo (PdfDocument destDocument, int insertBeforePage, IDictionary< PdfPage, PdfPage > page2page)
  Copies structure to a destDocument and insert it in a specified position in the document. More...
 
virtual void  Move (PdfPage fromPage, int insertBeforePage)
  Moves structure associated with specified page and insert it in a specified position in the document. More...
 
virtual int  GetParentTreeNextKey ()
 
virtual int  GetNextMcidForPage (PdfPage page)
 
virtual PdfDocument  GetDocument ()
 
virtual void  AddAssociatedFile (String description, PdfFileSpec fs)
  Adds file associated with structure tree root and identifies the relationship between them. More...
 
virtual void  AddAssociatedFile (PdfFileSpec fs)
 
virtual PdfArray  GetAssociatedFiles (bool create)
  Returns files associated with structure tree root. More...
 
virtual PdfStructIdTree  GetIdTree ()
  Returns the document's structure element ID tree wrapped in a PdfStructIdTree object. More...
 
- 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 PdfName  ConvertRoleToPdfName (String role)
 

Detailed Description

Represents a wrapper-class for structure tree root dictionary.

Represents a wrapper-class for structure tree root dictionary. See ISO-32000-1 "14.7.2 Structure hierarchy".

Constructor & Destructor Documentation

◆ PdfStructTreeRoot() [1/2]

iText.Kernel.Pdf.Tagging.PdfStructTreeRoot.PdfStructTreeRoot ( PdfDocument  document )
inline

Creates a new structure tree root instance, this initializes empty logical structure in the document.

Creates a new structure tree root instance, this initializes empty logical structure in the document. This class also handles global state of parent tree, so it's not expected to create multiple instances of this class. Instead, use iText.Kernel.Pdf.PdfDocument.GetStructTreeRoot().

Parameters
document a document to which new instance of struct tree root will be bound

◆ PdfStructTreeRoot() [2/2]

iText.Kernel.Pdf.Tagging.PdfStructTreeRoot.PdfStructTreeRoot ( PdfDictionary  structTreeRootDict,
PdfDocument  document 
)
inline

Creates wrapper instance for already existing logical structure tree root in the document.

Creates wrapper instance for already existing logical structure tree root in the document. This class also handles global state of parent tree, so it's not expected to create multiple instances of this class. Instead, use iText.Kernel.Pdf.PdfDocument.GetStructTreeRoot().

Parameters
structTreeRootDict a dictionary that defines document structure tree root
document a document, which contains given structure tree root dictionary

Member Function Documentation

◆ AddAssociatedFile() [1/2]

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

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

Adds file associated with structure tree root 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 tree root 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.PdfStructTreeRoot.AddAssociatedFile ( String  description,
PdfFileSpec  fs 
)
inlinevirtual

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

Adds file associated with structure tree root 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 tree root 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

◆ AddNamespace()

virtual void iText.Kernel.Pdf.Tagging.PdfStructTreeRoot.AddNamespace ( PdfNamespace namespace )
inlinevirtual

Adds a PdfNamespace to the list of the namespaces used within the document.

Adds a PdfNamespace to the list of the namespaces used within the document.

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

Parameters
namespace a PdfNamespace to be added.

◆ AddPronunciationLexicon()

virtual void iText.Kernel.Pdf.Tagging.PdfStructTreeRoot.AddPronunciationLexicon ( PdfFileSpec  pronunciationLexiconFileSpec )
inlinevirtual

Adds a single iText.Kernel.Pdf.Filespec.PdfFileSpec object, which specifies XML file conforming to PLS.

Adds a single iText.Kernel.Pdf.Filespec.PdfFileSpec object, which specifies XML file conforming to PLS. For more info see GetPronunciationLexiconsList().

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

Parameters
pronunciationLexiconFileSpec a iText.Kernel.Pdf.Filespec.PdfFileSpec object, which specifies XML file conforming to PLS.

◆ CopyTo() [1/2]

virtual void iText.Kernel.Pdf.Tagging.PdfStructTreeRoot.CopyTo ( PdfDocument  destDocument,
IDictionary< PdfPage, PdfPage page2page 
)
inlinevirtual

Copies structure to a destDocument .

Copies structure to a destDocument . NOTE: Works only for PdfStructTreeRoot that is read from the document opened in reading mode, otherwise an exception is thrown.

Parameters
destDocument document to copy structure to. Shall not be current document.
page2page association between original page and copied page.

◆ CopyTo() [2/2]

virtual void iText.Kernel.Pdf.Tagging.PdfStructTreeRoot.CopyTo ( PdfDocument  destDocument,
int  insertBeforePage,
IDictionary< PdfPage, PdfPage page2page 
)
inlinevirtual

Copies structure to a destDocument and insert it in a specified position in the document.

Copies structure to a destDocument and insert it in a specified position in the document. NOTE: Works only for PdfStructTreeRoot that is read from the document opened in reading mode, otherwise an exception is thrown.

Parameters
destDocument document to copy structure to.
insertBeforePage indicates where the structure to be inserted.
page2page association between original page and copied page.

◆ CreateParentTreeEntryForPage()

virtual void iText.Kernel.Pdf.Tagging.PdfStructTreeRoot.CreateParentTreeEntryForPage ( PdfPage  page )
inlinevirtual

Creates and flushes parent tree entry for the page.

Creates and flushes parent tree entry for the page. Effectively this means that new content mustn't be added to the page.

Parameters
page

iText.Kernel.Pdf.PdfPage for which to create parent tree entry. Typically this page is flushed after this call.

◆ GetAssociatedFiles()

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

Returns files associated with structure tree root.

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

◆ GetIdTree()

virtual PdfStructIdTree iText.Kernel.Pdf.Tagging.PdfStructTreeRoot.GetIdTree ( )
inlinevirtual

Returns the document's structure element ID tree wrapped in a PdfStructIdTree object.

Returns the document's structure element ID tree wrapped in a PdfStructIdTree object. If no such tree exists, it is initialized. The initialization happens lazily, and does not trigger any PDF object changes unless populated.

Returns
the PdfStructIdTree of the document

◆ GetKids()

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

Gets list of the direct kids of StructTreeRoot.

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

Returns
list of the direct kids of StructTreeRoot.

Implements iText.Kernel.Pdf.Tagging.IStructureNode.

◆ GetNamespaces()

virtual IList<PdfNamespace> iText.Kernel.Pdf.Tagging.PdfStructTreeRoot.GetNamespaces ( )
inlinevirtual

Gets namespaces used within the document.

Gets namespaces used within the document. Essentially this method returns value of GetNamespacesObject() wrapped in the PdfNamespace and System.Collections.IList classes. Therefore limitations of the referred method are applied to this method too.

Returns
a System.Collections.IList of PdfNamespace s used within the document.

◆ GetNamespacesObject()

virtual PdfArray iText.Kernel.Pdf.Tagging.PdfStructTreeRoot.GetNamespacesObject ( )
inlinevirtual

An array of namespaces used within the document.

An array of namespaces used within the document. This value, however, is not automatically updated while the document is processed. It identifies only the namespaces that were in the document at the moment of it's opening.

Returns

iText.Kernel.Pdf.PdfArray of namespaces used within the document.

◆ GetPageMarkedContentReferences()

virtual ICollection<PdfMcr> iText.Kernel.Pdf.Tagging.PdfStructTreeRoot.GetPageMarkedContentReferences ( PdfPage  page )
inlinevirtual

Gets an unmodifiable collection of marked content references on page.

Gets an unmodifiable collection of marked content references on page. NOTE: Do not remove tags when iterating over returned collection, this could lead to the ConcurrentModificationException, because returned collection is backed by the internal list of the actual page tags.

Parameters
page

iText.Kernel.Pdf.PdfPage to obtain unmodifiable collection of marked content references

Returns
the unmodifiable collection of marked content references on page, if no Mcrs defined returns null

◆ GetPronunciationLexiconsList()

virtual IList<PdfFileSpec> iText.Kernel.Pdf.Tagging.PdfStructTreeRoot.GetPronunciationLexiconsList ( )
inlinevirtual

A System.Collections.IList containing one or more iText.Kernel.Pdf.Filespec.PdfFileSpec objects, where each specified file is a pronunciation lexicon, which is an XML file conforming to the Pronunciation Lexicon Specification (PLS) Version 1.0.

A System.Collections.IList containing one or more iText.Kernel.Pdf.Filespec.PdfFileSpec objects, where each specified file is a pronunciation lexicon, which is an XML file conforming to the Pronunciation Lexicon Specification (PLS) Version 1.0. These pronunciation lexicons may be used as pronunciation hints when the document’s content is presented via text-to-speech. Where two or more pronunciation lexicons apply to the same text, the first match – as defined by the order of entries in the array and the order of entries inside the pronunciation lexicon file – should be used.

See ISO 32000-2 14.9.6, "Pronunciation hints".

Returns
A System.Collections.IList containing one or more iText.Kernel.Pdf.Filespec.PdfFileSpec.

◆ Move()

virtual void iText.Kernel.Pdf.Tagging.PdfStructTreeRoot.Move ( PdfPage  fromPage,
int  insertBeforePage 
)
inlinevirtual

Moves structure associated with specified page and insert it in a specified position in the document.

Moves structure associated with specified page and insert it in a specified position in the document.

NOTE: Works only for document with not flushed pages.

Parameters
fromPage page which tag structure will be moved
insertBeforePage indicates before tags of which page tag structure will be moved to