Class AccessibilityProperties
- java.lang.Object
-
- com.itextpdf.kernel.pdf.tagutils.AccessibilityProperties
-
- Direct Known Subclasses:
BackedAccessibilityProperties,DefaultAccessibilityProperties
public abstract class AccessibilityProperties extends java.lang.ObjectThe accessibility properties are used to define properties ofstructure elementsin Tagged PDF documents viaTagTreePointerAPI.
-
-
Constructor Summary
Constructors Constructor Description AccessibilityProperties()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AccessibilityPropertiesaddAttributes(int index, PdfStructureAttributes attributes)Adds the attributes to the element with specified index.AccessibilityPropertiesaddAttributes(PdfStructureAttributes attributes)Adds the attributes to the element.AccessibilityPropertiesaddRef(TagTreePointer treePointer)Adds the reference to other tagged element.AccessibilityPropertiesclearAttributes()Clears the list of attributes.AccessibilityPropertiesclearRefs()Clears the list of references to other tagged elements.java.lang.StringgetActualText()Gets the actual text of element.java.lang.StringgetAlternateDescription()Gets the alternate description of element.java.util.List<PdfStructureAttributes>getAttributesList()Gets the attributes list.java.lang.StringgetExpansion()Gets the expansion of element.java.lang.StringgetLanguage()Gets the language identifier of element.PdfNamespacegetNamespace()Gets the namespace of element.java.lang.StringgetPhoneme()Gets the phoneme of element.java.lang.StringgetPhoneticAlphabet()Gets the phonetic alphabet of element.java.util.List<TagTreePointer>getRefsList()Gets the list of references to other tagged elements.java.lang.StringgetRole()Gets the role of element.byte[]getStructureElementId()Gets the associated structure element's ID string, if it has one.AccessibilityPropertiessetActualText(java.lang.String actualText)Sets the actual text of element.AccessibilityPropertiessetAlternateDescription(java.lang.String alternateDescription)Sets the alternate description of element.AccessibilityPropertiessetExpansion(java.lang.String expansion)Sets the expansion of element.AccessibilityPropertiessetLanguage(java.lang.String language)Sets the language identifier of element.AccessibilityPropertiessetNamespace(PdfNamespace namespace)Sets the namespace of element.AccessibilityPropertiessetPhoneme(java.lang.String phoneme)Sets the phoneme of element.AccessibilityPropertiessetPhoneticAlphabet(java.lang.String phoneticAlphabet)Sets the phonetic alphabet of element.AccessibilityPropertiessetRole(java.lang.String role)Sets the role of element.AccessibilityPropertiessetStructureElementId(byte[] id)Sets the associated structure element's ID.AccessibilityPropertiessetStructureElementIdString(java.lang.String id)Sets the associated structure element's ID.
-
-
-
Method Detail
-
getRole
public java.lang.String getRole()
Gets the role of element.See also
StandardRoles.- Returns:
- the role
-
setRole
public AccessibilityProperties setRole(java.lang.String role)
Sets the role of element.See also
StandardRoles.Calling this method with a null argument will make the tagging on the associated layout element "neutral". The effect is that all children of the layout element will be tagged as if they were direct children of the parent element.
- Parameters:
role- the role to be set- Returns:
- this
AccessibilityPropertiesinstance
-
getLanguage
public java.lang.String getLanguage()
Gets the language identifier of element. Should be in format xy-ZK (for example en-US).For more information see PDF Specification ISO 32000-1 section 14.9.2.
- Returns:
- the language
-
setLanguage
public AccessibilityProperties setLanguage(java.lang.String language)
Sets the language identifier of element. Should be in format xy-ZK (for example en-US).For more information see PDF Specification ISO 32000-1 section 14.9.2.
- Parameters:
language- the language to be set- Returns:
- this
AccessibilityPropertiesinstance
-
getActualText
public java.lang.String getActualText()
Gets the actual text of element.- Returns:
- the actual text
-
setActualText
public AccessibilityProperties setActualText(java.lang.String actualText)
Sets the actual text of element.- Parameters:
actualText- the actual text to be set- Returns:
- this
AccessibilityPropertiesinstance
-
getAlternateDescription
public java.lang.String getAlternateDescription()
Gets the alternate description of element.- Returns:
- the alternate description
-
setAlternateDescription
public AccessibilityProperties setAlternateDescription(java.lang.String alternateDescription)
Sets the alternate description of element.- Parameters:
alternateDescription- the alternation description to be set- Returns:
- this
AccessibilityPropertiesinstance
-
getExpansion
public java.lang.String getExpansion()
Gets the expansion of element.Expansion it is the expanded form of an abbreviation of structure element.
- Returns:
- the expansion
-
setExpansion
public AccessibilityProperties setExpansion(java.lang.String expansion)
Sets the expansion of element.Expansion it is the expanded form of an abbreviation of structure element.
- Parameters:
expansion- the expansion to be set- Returns:
- this
AccessibilityPropertiesinstance
-
getPhoneme
public java.lang.String getPhoneme()
Gets the phoneme of element.For more information see
PdfStructElem.setPhoneme(PdfString).- Returns:
- the phoneme
-
setPhoneme
public AccessibilityProperties setPhoneme(java.lang.String phoneme)
Sets the phoneme of element.For more information see
PdfStructElem.setPhoneme(PdfString).- Parameters:
phoneme- the phoneme to be set- Returns:
- this
AccessibilityPropertiesinstance
-
getPhoneticAlphabet
public java.lang.String getPhoneticAlphabet()
Gets the phonetic alphabet of element.For more information see
PdfStructElem.setPhoneticAlphabet(PdfName).- Returns:
- the phonetic alphabet
-
setPhoneticAlphabet
public AccessibilityProperties setPhoneticAlphabet(java.lang.String phoneticAlphabet)
Sets the phonetic alphabet of element.For more information see
PdfStructElem.setPhoneticAlphabet(PdfName).- Parameters:
phoneticAlphabet- the phonetic alphabet to be set- Returns:
- this
AccessibilityPropertiesinstance
-
getNamespace
public PdfNamespace getNamespace()
Gets the namespace of element.- Returns:
- the namespace
-
setNamespace
public AccessibilityProperties setNamespace(PdfNamespace namespace)
Sets the namespace of element.- Parameters:
namespace- the namespace to be set- Returns:
- this
AccessibilityPropertiesinstance
-
addRef
public AccessibilityProperties addRef(TagTreePointer treePointer)
Adds the reference to other tagged element.For more information see
PdfStructElem.addRef(PdfStructElem).- Parameters:
treePointer- the reference to be set- Returns:
- this
AccessibilityPropertiesinstance
-
getRefsList
public java.util.List<TagTreePointer> getRefsList()
Gets the list of references to other tagged elements.For more information see
PdfStructElem.addRef(PdfStructElem).- Returns:
- the list of references
-
clearRefs
public AccessibilityProperties clearRefs()
Clears the list of references to other tagged elements.For more information see
PdfStructElem.addRef(PdfStructElem).- Returns:
- this
AccessibilityPropertiesinstance
-
addAttributes
public AccessibilityProperties addAttributes(PdfStructureAttributes attributes)
Adds the attributes to the element.- Parameters:
attributes- the attributes to be added- Returns:
- this
AccessibilityPropertiesinstance
-
addAttributes
public AccessibilityProperties addAttributes(int index, PdfStructureAttributes attributes)
Adds the attributes to the element with specified index.If an attribute with the same O and NS entries is specified more than once, the later (in array order) entry shall take precedence. For more information see PDF Specification ISO-32000 section 14.7.6.
- Parameters:
index- the attributes indexattributes- the attributes to be added- Returns:
- this
AccessibilityPropertiesinstance
-
clearAttributes
public AccessibilityProperties clearAttributes()
Clears the list of attributes.- Returns:
- this
AccessibilityPropertiesinstance
-
getAttributesList
public java.util.List<PdfStructureAttributes> getAttributesList()
Gets the attributes list.- Returns:
- the attributes list
-
getStructureElementId
public byte[] getStructureElementId()
Gets the associated structure element's ID string, if it has one.See also
PdfStructElem.getStructureElementId().- Returns:
- the structure element's ID string, or null if there is none
-
setStructureElementId
public AccessibilityProperties setStructureElementId(byte[] id)
Sets the associated structure element's ID. Passingnullremoves the ID.- Parameters:
id- the element's ID to be set- Returns:
- this
AccessibilityPropertiesinstance
-
setStructureElementIdString
public AccessibilityProperties setStructureElementIdString(java.lang.String id)
Sets the associated structure element's ID. Passingnullremoves the ID. If non-null, the argument will be encoded in UTF-8 (without BOM), since ID strings are considered binary data in PDF.- Parameters:
id- the element's ID to be set- Returns:
- this
AccessibilityPropertiesinstance
-
-