iText 8.0.2 API
|
TagTreePointer class is used to modify the document's tag tree. More...
Public Member Functions |
|
TagTreePointer (PdfDocument document) | |
Creates TagTreePointer instance. More... |
|
TagTreePointer (iText.Kernel.Pdf.Tagutils.TagTreePointer tagPointer) | |
A copy constructor. More... |
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | SetPageForTagging (PdfPage page) |
Sets a page which content will be tagged with this instance of TagTreePointer . More... |
|
virtual PdfPage | GetCurrentPage () |
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | SetContentStreamForTagging (PdfStream contentStream) |
Sometimes, tags are desired to be connected with the content that resides not in the page's content stream, but rather in the some appearance stream or in the form xObject stream. More... |
|
virtual PdfStream | GetCurrentContentStream () |
virtual TagStructureContext | GetContext () |
virtual PdfDocument | GetDocument () |
|
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | SetNamespaceForNewTags (PdfNamespace @namespace) |
Sets a iText.Kernel.Pdf.Tagging.PdfNamespace which will be set to every new tag created by this TagTreePointer instance if this tag doesn't explicitly define namespace by the means of DefaultAccessibilityProperties.SetNamespace(iText.Kernel.Pdf.Tagging.PdfNamespace). More... |
|
virtual PdfNamespace | GetNamespaceForNewTags () |
Gets a iText.Kernel.Pdf.Tagging.PdfNamespace which will be set to every new tag created by this TagTreePointer instance. More... |
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | AddTag (String role) |
Adds a new tag with given role to the tag structure. More... |
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | AddTag (int index, String role) |
Adds a new tag with given role to the tag structure. More... |
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | AddTag (AccessibilityProperties properties) |
Adds a new tag to the tag structure. More... |
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | AddTag (int index, AccessibilityProperties properties) |
Adds a new tag to the tag structure. More... |
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | AddAnnotationTag (PdfAnnotation annotation) |
Adds a new content item for the given PdfAnnotation under the current tag. More... |
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | SetNextNewKidIndex (int nextNewKidIndex) |
Sets index of the next added to the current tag kid, which could be another tag or content item. More... |
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | RemoveTag () |
Removes the current tag. More... |
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | RelocateKid (int kidIndex, iText.Kernel.Pdf.Tagutils.TagTreePointer pointerToNewParent) |
Moves kid of the current tag to the tag at which given TagTreePointer points. More... |
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | Relocate (iText.Kernel.Pdf.Tagutils.TagTreePointer pointerToNewParent) |
Moves current tag to the tag at which given TagTreePointer points. More... |
|
virtual TagReference | GetTagReference () |
Creates a reference to the current tag, which could be used to associate a content on the PdfCanvas with current tag. More... |
|
virtual TagReference | GetTagReference (int index) |
Creates a reference to the current tag, which could be used to associate a content on the PdfCanvas with current tag. More... |
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | MoveToRoot () |
Moves this TagTreePointer instance to the document root tag. More... |
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | MoveToParent () |
Moves this TagTreePointer instance to the parent of the current tag. More... |
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | MoveToKid (int kidIndex) |
Moves this TagTreePointer instance to the kid of the current tag. More... |
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | MoveToKid (String role) |
Moves this TagTreePointer instance to the first descendant of the current tag which has the given role. More... |
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | MoveToKid (int n, String role) |
Moves this TagTreePointer instance to the nth descendant of the current tag which has the given role. More... |
|
virtual IList< String > | GetKidsRoles () |
Gets current tag kids roles. More... |
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | FlushTag () |
Flushes current tag and all it's descendants. More... |
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | FlushParentsIfAllKidsFlushed () |
For current tag and all of it's parents consequentially checks if the following constraints apply, and flushes the tag if they do or stops if they don't:
|
|
virtual AccessibilityProperties | GetProperties () |
Gets accessibility properties of the current tag. More... |
|
virtual String | GetRole () |
Gets current tag role. More... |
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | SetRole (String role) |
Sets new role to the current tag. More... |
|
virtual int | GetIndexInParentKidsList () |
Defines index of the current tag in the parent's kids list. More... |
|
virtual iText.Kernel.Pdf.Tagutils.TagTreePointer | MoveToPointer (iText.Kernel.Pdf.Tagutils.TagTreePointer tagTreePointer) |
Moves this TagTreePointer instance to the tag at which given TagTreePointer instance is pointing. More... |
|
virtual bool | IsPointingToSameTag (iText.Kernel.Pdf.Tagutils.TagTreePointer otherPointer) |
Checks if this TagTreePointer is pointing at the same tag as the giving TagTreePointer. More... |
|
TagTreePointer class is used to modify the document's tag tree.
TagTreePointer class is used to modify the document's tag tree. At any given moment, instance of this class 'points' at the specific position in the tree (at the specific tag), however every instance can be freely moved around the tree primarily using MoveToKid(int) and MoveToParent() methods. For the current tag you can add new tags, modify it's role and properties, etc. Also, using instance of this class, you can change tag position in the tag structure, you can flush current tag or remove it.
There could be any number of the instances of this class, simultaneously pointing to different (or the same) parts of the tag structure. Because of this, you can for example remove the tag at which another instance is currently pointing. In this case, this another instance becomes invalid, and invocation of any method on it will result in exception. To make given instance valid again, use MoveToRoot() method.
|
inline |
Creates TagTreePointer
instance.
Creates TagTreePointer
instance. After creation TagTreePointer
points at the root tag.
The iText.Kernel.Pdf.Tagging.PdfNamespace for the new tags, which don't explicitly define namespace by the means of DefaultAccessibilityProperties.SetNamespace(iText.Kernel.Pdf.Tagging.PdfNamespace) , is set to the value returned by TagStructureContext.GetDocumentDefaultNamespace() on TagTreePointer creation. See also SetNamespaceForNewTags(iText.Kernel.Pdf.Tagging.PdfNamespace).
document | the document, at which tag structure this instance will point. |
|
inline |
A copy constructor.
tagPointer | the TagTreePointer from which current position and page are copied. |
|
inlinevirtual |
Adds a new content item for the given PdfAnnotation
under the current tag.
Adds a new content item for the given PdfAnnotation
under the current tag.
By default, when annotation is added to the page it is automatically tagged with auto tagging pointer (see TagStructureContext.GetAutoTaggingPointer() ). If you want to add annotation tag manually, be sure to use iText.Kernel.Pdf.PdfPage.AddAnnotation(int, iText.Kernel.Pdf.Annot.PdfAnnotation, bool) method with false for boolean flag.
annotation |
PdfAnnotation
to be tagged.
|
inlinevirtual |
Adds a new tag to the tag structure.
Adds a new tag to the tag structure. This method call moves this TagTreePointer to the added kid.
New tag will have a role and attributes defined by the given AccessibilityProperties.
properties | accessibility properties which define a new tag role and other properties. |
|
inlinevirtual |
Adds a new tag to the tag structure.
Adds a new tag to the tag structure. This method call moves this TagTreePointer
to the added kid.
New tag will have a role and attributes defined by the given AccessibilityProperties. This call is equivalent of calling sequentially SetNextNewKidIndex(int) and AddTag(AccessibilityProperties).
index | zero-based index in kids array of parent tag at which new tag will be added. |
properties | accessibility properties which define a new tag role and other properties. |
|
inlinevirtual |
Adds a new tag with given role to the tag structure.
Adds a new tag with given role to the tag structure. This method call moves this TagTreePointer
to the added kid.
This call is equivalent of calling sequentially SetNextNewKidIndex(int) and AddTag(System.String).
index | zero-based index in kids array of parent tag at which new tag will be added. |
role | role of the new tag. |
|
inlinevirtual |
Adds a new tag with given role to the tag structure.
Adds a new tag with given role to the tag structure. This method call moves this TagTreePointer
to the added kid.
role | role of the new tag. |
|
inlinevirtual |
For current tag and all of it's parents consequentially checks if the following constraints apply, and flushes the tag if they do or stops if they don't:
For current tag and all of it's parents consequentially checks if the following constraints apply, and flushes the tag if they do or stops if they don't:
It makes sense to use this method in conjunction with TagStructureContext.FlushPageTags(iText.Kernel.Pdf.PdfPage) for the tags which have just lost their waiting state and might be not flushed only because they had one. This helps to eliminate hanging (not flushed) tags when they don't have waiting state anymore.
|
inlinevirtual |
Flushes current tag and all it's descendants.
Flushes current tag and all it's descendants. This method call moves this TagTreePointer
to the current tag parent.
If some of the descendant tags of the current tag have waiting state (see WaitingTagsManager ), then these tags are considered as not yet finished ones, and they won't be flushed immediately, but they will be flushed, when waiting state is removed.
|
inlinevirtual |
|
inlinevirtual |
TagTreePointer
.
|
inlinevirtual |
TagTreePointer
.
|
inlinevirtual |
Defines index of the current tag in the parent's kids list.
|
inlinevirtual |
Gets current tag kids roles.
Gets current tag kids roles. If certain kid is already flushed, at its position there will be a null
. If kid is a content item, at it's position there will be "MCR" string literal (stands for Marked Content Reference).
|
inlinevirtual |
Gets a iText.Kernel.Pdf.Tagging.PdfNamespace which will be set to every new tag created by this TagTreePointer instance.
|
inlinevirtual |
Gets accessibility properties of the current tag.
|
inlinevirtual |
Gets current tag role.
|
inlinevirtual |
Creates a reference to the current tag, which could be used to associate a content on the PdfCanvas with current tag.
Creates a reference to the current tag, which could be used to associate a content on the PdfCanvas with current tag. See iText.Kernel.Pdf.Canvas.PdfCanvas.OpenTag(TagReference) and SetPageForTagging(iText.Kernel.Pdf.PdfPage).
|
inlinevirtual |
Creates a reference to the current tag, which could be used to associate a content on the PdfCanvas with current tag.
Creates a reference to the current tag, which could be used to associate a content on the PdfCanvas with current tag. See iText.Kernel.Pdf.Canvas.PdfCanvas.OpenTag(TagReference) and SetPageForTagging(iText.Kernel.Pdf.PdfPage).
index | zero-based index in kids array of tag. These indexes define the logical order of the content on the page. |
|
inlinevirtual |
Checks if this TagTreePointer is pointing at the same tag as the giving TagTreePointer.
otherPointer | a TagTreePointer which is checked against this instance on whether they point at the same tag. |
|
inlinevirtual |
Moves this TagTreePointer
instance to the kid of the current tag.
kidIndex | zero-based index of the current tag kid to which pointer will be moved. |
|
inlinevirtual |
Moves this TagTreePointer instance to the nth descendant of the current tag which has the given role.
Moves this TagTreePointer instance to the nth descendant of the current tag which has the given role. If there are no direct kids of the tag with such role, further descendants are checked in BFS order.
n | if there are several descendants with the given role, pointer will be moved to the descendant which has zero-based index n if you count only the descendants with the given role in BFS order. |
role | role of the current tag descendant to which pointer will be moved. |
|
inlinevirtual |
Moves this TagTreePointer instance to the first descendant of the current tag which has the given role.
Moves this TagTreePointer instance to the first descendant of the current tag which has the given role. If there are no direct kids of the tag with such role, further descendants are checked in BFS order.
role | role of the current tag descendant to which pointer will be moved. If there are several descendants with this role, pointer will be moved to the first kid with such role in BFS order. |
|
inlinevirtual |
Moves this TagTreePointer instance to the parent of the current tag.
|
inlinevirtual |
Moves this TagTreePointer instance to the tag at which given TagTreePointer instance is pointing.
tagTreePointer | a TagTreePointer that points at the tag which will become the current tag of this instance. |
|
inlinevirtual |
Moves this TagTreePointer
instance to the document root tag.
|
inlinevirtual |
Moves current tag to the tag at which given TagTreePointer
points.
Moves current tag to the tag at which given TagTreePointer
points. This method doesn't change either this instance or pointerToNewParent position.
pointerToNewParent | the TagTreePointer which is positioned at the tag which will become current tag new parent. |
|
inlinevirtual |
Moves kid of the current tag to the tag at which given TagTreePointer
points.
Moves kid of the current tag to the tag at which given TagTreePointer
points. This method doesn't change neither this instance nor pointerToNewParent position.
kidIndex | zero-based index of the current tag's kid to be relocated. |
pointerToNewParent | the TagTreePointer which is positioned at the tag which will become kid's new parent. |
|
inlinevirtual |
Removes the current tag.
Removes the current tag. If it has kids, they will become kids of the current tag parent. This method call moves this TagTreePointer
to the current tag parent.
You cannot remove root tag, and also you cannot remove the tag if it's parent is already flushed; in this two cases an exception will be thrown.
|
inlinevirtual |
Sometimes, tags are desired to be connected with the content that resides not in the page's content stream, but rather in the some appearance stream or in the form xObject stream.
Sometimes, tags are desired to be connected with the content that resides not in the page's content stream, but rather in the some appearance stream or in the form xObject stream. In that case, to have a valid tag structure, one shall set not only the page, on which the content will be rendered, but also the content stream in which the tagged content will reside.
NOTE: It's important to set a null
for this value, when tagging of this stream content is finished.
contentStream | the content stream which content will be tagged with this instance of TagTreePointer or null if content stream tagging is finished |
|
inlinevirtual |
Sets a iText.Kernel.Pdf.Tagging.PdfNamespace which will be set to every new tag created by this TagTreePointer instance if this tag doesn't explicitly define namespace by the means of DefaultAccessibilityProperties.SetNamespace(iText.Kernel.Pdf.Tagging.PdfNamespace).
Sets a iText.Kernel.Pdf.Tagging.PdfNamespace which will be set to every new tag created by this TagTreePointer instance if this tag doesn't explicitly define namespace by the means of DefaultAccessibilityProperties.SetNamespace(iText.Kernel.Pdf.Tagging.PdfNamespace).
This value has meaning only for the PDF documents of version 2.0 and higher.
It's highly recommended to acquire iText.Kernel.Pdf.Tagging.PdfNamespace class instances via TagStructureContext.FetchNamespace(System.String).
namespace | a iText.Kernel.Pdf.Tagging.PdfNamespace to be set for the new tags created. If set to null - new tags will have a namespace set only if it is defined in the corresponding AccessibilityProperties. |
|
inlinevirtual |
Sets index of the next added to the current tag kid, which could be another tag or content item.
Sets index of the next added to the current tag kid, which could be another tag or content item. By default, new tag is added at the end of the parent kids array. This property affects only the next added tag, all tags added after will be added with the default behaviour.
This method could be used with any overload of AddTag(System.String) method, with RelocateKid(int, TagTreePointer) and AddAnnotationTag(iText.Kernel.Pdf.Annot.PdfAnnotation).
Keep in mind, that this method set property to the TagTreePointer
and not to the tag itself, which means that if you would move the pointer, this property would be applied to the new current tag.
nextNewKidIndex | index of the next added kid. |
|
inlinevirtual |
Sets a page which content will be tagged with this instance of TagTreePointer
.
Sets a page which content will be tagged with this instance of TagTreePointer
. To tag page content:
PdfCanvas
; page | the page which content will be tagged with this instance of TagTreePointer . |
|
inlinevirtual |
Sets new role to the current tag.
role | new role to be set. |