Generated by
JDiff

com.itextpdf.kernel.pdf.tagutils Documentation Differences

This file contains all the changes in documentation in the package com.itextpdf.kernel.pdf.tagutils as colored differences. Deletions are shown like this , and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a tag will cause all subsequent paragraphs to be displayed differently.

Class IRoleMappingResolver

A helper interface that facilitates roles mapping resolving for the tag structures that are defined for different PDF document specification versions.

Be aware, that it is explicitly allowed for the document by the specification to have circular or transitive mappings.


Class TagStructureContext, PdfNamespace fetchNamespace(String)

This method defines a recommended way to obtain PdfNamespace class instances.

Returns either a wrapper over an already existing namespace dictionary in the document or over a new one if such namespace wasn't encountered before. Calling this method is considered as encountering a namespace, i.e. two sequential calls on this method will return the same namespace instance (which is not true in general case of two method calls, for instance if several namespace instances with the same name are created via PdfNamespace constructors and set to the elements of the tag structure, then the last encountered one will be returned by this method). However encountered namespaces will not be added to the document's structure tree root /Namespaces array unless they were set to the certain element of the tag structure. @param namespaceName a String defining the namespace name (conventionally a uniform resource identifier, or URI). @return PdfNamespace wrapper over either already existing namespace object or over the new one.

Class TagStructureContext, PdfNamespace getDocumentDefaultNamespace()

A namespace that is used as a default value for the tagging for any new TagTreePointer created (including the pointer returned by .getAutoTaggingPointer(), which implies that automatically created tag structure will be in this namespace by default).

By default, this value is defined based on the PDF document version and the existing tag structure inside a document. For the new empty PDF 2.0 documents this namespace is set to StandardNamespaces.PDF_2_0.

This value has meaning only for the PDF documents of version 2.0 and higher. @return a PdfNamespace which is used as a default value for the document tagging.

Class TagStructureContext, PdfStructElem getPointerStructElem(TagTreePointer)

Gets PdfStructElem at which TagTreePointer points.

NOTE: Be aware that PdfStructElem is a low level class, use it carefully, especially in conjunction with high level TagTreePointer and TagStructureContext classes. @param pointer a TagTreePointer which points at desired PdfStructElem. @return a PdfStructElem at which given TagTreePointer points.

Class TagStructureContext, TagStructureContext setDocumentDefaultNamespace(PdfNamespace)

Sets a namespace that will be used as a default value for the tagging for any new TagTreePointer created. See .getDocumentDefaultNamespace() for more info.

Be careful when changing this property value. It is most recommended to do it right after the PdfDocument was created, before any content was added. Changing this value after any content was added might result in the mingled tag structure from the namespaces point of view. So in order to maintain the document consistent but in the namespace different from default, set this value before any modifications to the document were made and before .getAutoTaggingPointer() method was called for the first time.

This value has meaning only for the PDF documents of version 2.0 and higher. @param namespace a PdfNamespace which is to be used as a default value for the document tagging. @return current TagStructureContext instance.


Class TagTreePointer

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 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.

Class TagTreePointer, constructor TagTreePointer(PdfDocument)

Creates {@code TagTreePointer} instance. After creation {@code TagTreePointer} points at the root tag.

The PdfNamespace for the new tags, which don't explicitly define namespace by the means of DefaultAccessibilityProperties.setNamespace(PdfNamespace), is set to the value returned by TagStructureContext.getDocumentDefaultNamespace() on TagTreePointer creation. See also TagTreePointer.setNamespaceForNewTags(PdfNamespace). @param document the document, at which tag structure this instance will point.

Class TagTreePointer, 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: It makes sense to use this method in conjunction with TagStructureContext.flushPageTags(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. @return this TagTreePointer instance.
Class TagTreePointer, TagTreePointer flushTag()

Flushes current tag and all it's descendants. This method call moves this {@code 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. @return this TagTreePointer instance.

Class TagTreePointer, TagTreePointer setNamespaceForNewTags(PdfNamespace)

Sets a 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(PdfNamespace).

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

It's highly recommended to acquire PdfNamespace class instances via TagStructureContext.fetchNamespace(String). @param namespace a 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. @return this TagTreePointer instance. @see TagStructureContext#fetchNamespace(String)

Class TagTreePointer, TagTreePointer setPageForTagging(PdfPage)

Sets a page which content will be tagged with this instance of {@code TagTreePointer}. To tag page content:
  1. Set pointer position to the tag which will be the parent of the page content item;
  2. Call .getTagReference() to obtain the reference to the current tag;
  3. Pass TagReference to the PdfCanvas.openTag(TagReference) method of the page's PdfCanvas to start marked content item;
  4. Draw content on {@code PdfCanvas};
  5. Use PdfCanvas.closeTag() to finish marked content item.
@param page the page which content will be tagged with this instance of {@code TagTreePointer}. @return this TagTreePointer instance.

Class WaitingTagsManager

This class is used to manage waiting tags state. Any tag in the structure tree could be marked as "waiting". This state indicates that tag is not yet finished and therefore should not be flushed or removed if page tags are flushed or removed or if parent tags are flushed.

Waiting state of tags is defined by the association with arbitrary objects instances.

Waiting state could also be perceived as a temporal association of the object to some particular tag.

Class WaitingTagsManager, void removeAllWaitingStates()

Removes waiting state of all waiting tags by removing association with objects.

NOTE: if parent of the waiting tag is already flushed, the tag and it's children will be also immediately flushed right after the waiting state removal.

Class WaitingTagsManager, boolean removeWaitingState(Object)

Removes waiting state of the tag which is associated with the given object.

NOTE: if parent of the waiting tag is already flushed, the tag and it's children (unless they are waiting tags on their own) will be also immediately flushed right after the waiting state removal. @param associatedObject an object which association with the waiting tag is to be removed. @return true if object was actually associated with some tag and it's association was removed.