PDFix SDK  6.5.0
PdsStructElement Struct Referenceabstract

PdsStructElement class. More...

Public Member Functions

virtual void Release ()=0
 Releases structure element's resources. More...
 
virtual int GetType (bool mapped, wchar_t *buffer, int len)=0
 
virtual int GetActualText (wchar_t *buffer, int len)=0
 
virtual bool SetActualText (const wchar_t *alt)=0
 
virtual int GetAlt (wchar_t *buffer, int len)=0
 
virtual bool SetAlt (const wchar_t *alt)=0
 
virtual int GetTitle (wchar_t *buffer, int len)=0
 Gets the title of the specified element, returning the number of bytes in the title. More...
 
virtual bool SetTitle (const wchar_t *title)=0
 Sets the title associated with an element. More...
 
virtual int GetAbbreviation (wchar_t *buffer, int len)=0
 Gets the expanded form of an abbreviation. More...
 
virtual int GetPageNumber ()=0
 
virtual PdsObjectGetAttrObject (int index)=0
 
virtual bool AddAttrObj (PdsObject *object)=0
 Associates the specified attribute object with an element. More...
 
virtual void RemoveAttrObj ()=0
 
virtual PdsObjectGetElementObject ()=0
 
virtual PdsObjectGetKidObject (int index)=0
 
virtual PdfStructElementType GetKidType (int index)=0
 
virtual int GetKidPageNumber (int index)=0
 Returns a page number representing a page on which the kid is rendered. More...
 
virtual int GetKidMcid (int index)=0
 
virtual int GetNumAttrObjects ()=0
 Gets the number of attribute objects directly attached to the specified element. More...
 
virtual int GetNumKids ()=0
 Gets the number of kids of the specified element. More...
 
virtual PdsObjectGetParentObject ()=0
 
virtual int GetId (wchar_t *buffer, int len)=0
 
virtual bool SetId (const wchar_t *id)=0
 Sets the id associated with an element. More...
 
virtual int GetLang (wchar_t *buffer, int len)=0
 
virtual bool SetLang (const wchar_t *alt)=0
 Sets the Lang entry of a struct element. More...
 
virtual bool RemoveKid (int index)=0
 Removes the specified kid from an element. More...
 
virtual PdsStructElementCreateStructElement (const wchar_t *type, PdsStructElement *parent, int index)=0
 
virtual bool SetParent (PdsStructElement *parent, int index)=0
 Moves the current structure element. More...
 
virtual void AddPageObject (PdsPageObject *object, int index)=0
 
virtual void AddAnnot (PdfAnnot *annot, int index)=0
 
virtual PdsStructTreeGetStructTree ()=0
 Get pointer to the parent struct tree object.
 
virtual bool SetType (const wchar_t *type)=0
 Sets the struct element type. More...
 

Detailed Description

PdsStructElement class.

PdsStructElement is the basic building block of the structure tree. It represents PDF structural elements, which are nodes in a tree, defining a PDF document�s logical structure.

Member Function Documentation

◆ AddAnnot()

virtual void PdsStructElement::AddAnnot ( PdfAnnot annot,
int  index 
)
pure virtual

Inserts a reference to the specified annotation as a kid into the specified element. This method automatically creates OBJR object.

Parameters
objectThe annotation to insert.
indexPosition where the annotation object is inserted.

◆ AddAttrObj()

virtual bool PdsStructElement::AddAttrObj ( PdsObject object)
pure virtual

Associates the specified attribute object with an element.

Parameters
objectAttribute object to associate with element.

◆ AddPageObject()

virtual void PdsStructElement::AddPageObject ( PdsPageObject object,
int  index 
)
pure virtual

Inserts a reference to the specified page object as a kid into the specified element. This method automatically creates MCR objects if needed.

Parameters
objectThe page object to insert.
indexPosition where the page object is inserted.

◆ CreateStructElement()

virtual PdsStructElement* PdsStructElement::CreateStructElement ( const wchar_t *  type,
PdsStructElement parent,
int  index 
)
pure virtual

Creates a new (but empty) PdsStructElement of specific type. CreateStructElement increments an element�s reference count. The element will not be released until the reference count is zero, or the application terminates. NOTE: After you are done using the element, release it using PdsStructElement::Release to release resources.

Parameters
typeThe name representing the element�s type.
parentThe parent structure element.
indexPosition where the kid is inserted to parents kids. If element currently has no kids, index is ignored.
Returns
Acquired PdsStructElement.
See also
PdsStructElement::Release

◆ GetAbbreviation()

virtual int PdsStructElement::GetAbbreviation ( wchar_t *  buffer,
int  len 
)
pure virtual

Gets the expanded form of an abbreviation.

Parameters
buffer(filled by method) If the buffer is null function returns required length of string
lenLength of a buffer to be filled in.
Returns
Number of characters written into buffer of required length.

◆ GetActualText()

virtual int PdsStructElement::GetActualText ( wchar_t *  buffer,
int  len 
)
pure virtual

Gets the actual text associated with the specified PDSElement. Returns the number of bytes in the text or 0 if the element has no actual text or has an empty string. To check for the existence of alternate text, check for a non-zero return value.

Parameters
buffer(filled by method) If the buffer is null function returns required length of string
lenLength of a buffer to be filled in.
Returns
Number of characters written into buffer of required length.

◆ GetAlt()

virtual int PdsStructElement::GetAlt ( wchar_t *  buffer,
int  len 
)
pure virtual

Gets the alternate text associated with an element. NOTE: The Alt text can be legally defined as an empty string. To differentiate between an Alt text string of zero length and no Alt text being defined, call HasAlt first.

Parameters
buffer(filled by method) If the buffer is null function returns required length of string
lenLength of a buffer to be filled in.
Returns
Number of characters written into buffer of required length.

◆ GetAttrObject()

virtual PdsObject* PdsStructElement::GetAttrObject ( int  index)
pure virtual

Gets the attribute object at a specified array index in the specified element. If there is only one attribute object(that is, there is no array of attributes), and index is zero, that attribute object is obtained.

Parameters
indexIndex of the attribute object to obtain.
Returns
Attribute object at index.

◆ GetElementObject()

virtual PdsObject* PdsStructElement::GetElementObject ( )
pure virtual

Gets the object corresponding to the specified element object. This method does not copy the object, but is instead the logical equivalent of a type cast

Returns
The dictionary object for the element object.

◆ GetId()

virtual int PdsStructElement::GetId ( wchar_t *  buffer,
int  len 
)
pure virtual

Gets the ID of an element. The element identifier, a string designating this structure element. The string must be unique among all elements in the document's structure hierarchy. The IDTree entry in the structure tree root defines the correspondence between element identifiers and the structure elements they denote.

Parameters
buffer(filled by method) If the buffer is null function returns required length of string
lenLength of a buffer to be filled in.
Returns
Number of characters written into buffer of required length.

◆ GetKidMcid()

virtual int PdsStructElement::GetKidMcid ( int  index)
pure virtual

Returns a kid's MCID. Note: Call this method only in a case that PdfStructElement::GetKidType returns kPdsStructKidPageContent type. Otherwise this method it returns -1.

Parameters
indexThe index of the kid.
Returns
The kid's MCID if presented, -1 otherwise.

◆ GetKidObject()

virtual PdsObject* PdsStructElement::GetKidObject ( int  index)
pure virtual

Gets the kid's object at an array index for the structure element. A PDF structural elements unlike the structure tree root�can have several different kinds of children : marked content ID, another structural element, or an object reference.

Parameters
indexThe index of the kid.
Returns
The kid's object being accessed.
See also
PdsStructTree::AcquireStructElement

◆ GetKidPageNumber()

virtual int PdsStructElement::GetKidPageNumber ( int  index)
pure virtual

Returns a page number representing a page on which the kid is rendered.

Parameters
indexThe index of the kid.
Returns
The page number if presented, -1 otherwise.

◆ GetKidType()

virtual PdfStructElementType PdsStructElement::GetKidType ( int  index)
pure virtual

Gets the kid's type at an array index for the structure element. A PDF structural elements unlike the structure tree root can have several different kinds of children : marked content ID, another structure element, or an object object reference dictionary denoting a PdsObject.

Parameters
indexThe index of the kid.
Returns
The type of the kid.

◆ GetLang()

virtual int PdsStructElement::GetLang ( wchar_t *  buffer,
int  len 
)
pure virtual

Gets the Lang entry of a struct element. A language identifier specifying the natural language for all text in the structure element except where overridden by language specifications for nested structure elements or marked content

Parameters
buffer(filled by method) If the buffer is null function returns required length of string
lenLength of a buffer to be filled in.
Returns
Number of characters written into buffer of required length.

◆ GetNumAttrObjects()

virtual int PdsStructElement::GetNumAttrObjects ( )
pure virtual

Gets the number of attribute objects directly attached to the specified element.

Returns
Number of attribute objects directly attached to element.

◆ GetNumKids()

virtual int PdsStructElement::GetNumKids ( )
pure virtual

Gets the number of kids of the specified element.

Returns
Number of direct kids of element.

◆ GetPageNumber()

virtual int PdsStructElement::GetPageNumber ( )
pure virtual

Returns a page number representing a page on which some or all of the content items designated by the K entry are rendered

Returns
The page number if presented, -1 otherwise.

◆ GetParentObject()

virtual PdsObject* PdsStructElement::GetParentObject ( )
pure virtual

Gets the immediate ancestor element of the specified element in the tree. If the element�s parent is another element, parent is set to that parent's object.

Parameters
parent(filled by method) The element parent's object.
Returns
Element's parent object. If the element�s parent is the structure tree root, return value is nullptr.

◆ GetTitle()

virtual int PdsStructElement::GetTitle ( wchar_t *  buffer,
int  len 
)
pure virtual

Gets the title of the specified element, returning the number of bytes in the title.

Parameters
buffer(filled by method) If the buffer is null function returns required length of string
lenLength of a buffer to be filled in.
Returns
Number of characters written into buffer of required length.

◆ GetType()

virtual int PdsStructElement::GetType ( bool  mapped,
wchar_t *  buffer,
int  len 
)
pure virtual

Gets the element's structural element type. It maps an element type to another element type if the specified element type has role mapping.

Parameters
buffer(filled by method) If the buffer is null function returns required length of string
lenLength of a buffer to be filled in.
Returns
Number of characters written into buffer of required length.

◆ Release()

virtual void PdsStructElement::Release ( )
pure virtual

Releases structure element's resources.

Parameters
elementThe structure element to release.
See also
PdsStructTree::AcquireStructElement

◆ RemoveAttrObj()

virtual void PdsStructElement::RemoveAttrObj ( )
pure virtual

Removes the specified attribute object from an element. If element does not have an attrObj attribute, this method does nothing.

◆ RemoveKid()

virtual bool PdsStructElement::RemoveKid ( int  index)
pure virtual

Removes the specified kid from an element.

Parameters
indexThe index of the kid.
Returns
True if successfull, falsw othervise.

◆ SetActualText()

virtual bool PdsStructElement::SetActualText ( const wchar_t *  alt)
pure virtual

Sets the Actual Text text associated with an element. Text that is an exact replacement for the structure element and its children. This replacement text (which should apply to as small a piece of content as possible) is useful when extracting the document’s contents in support of accessibility to users with disabilities or for other purposes

Parameters
titleString value to be set for the ActualText.
Returns
true if optaining the font state was succsessfull, false otherwise.

◆ SetAlt()

virtual bool PdsStructElement::SetAlt ( const wchar_t *  alt)
pure virtual

Sets the alternate text associated with an element. NOTE: The Alt text can be legally defined as an empty string. To differentiate between an Alt text string of zero length and no Alt text being defined, call HasAlt first.

Parameters
altString value to be set for the alt text.
Returns
true if optaining the font state was succsessfull, false otherwise.

◆ SetId()

virtual bool PdsStructElement::SetId ( const wchar_t *  id)
pure virtual

Sets the id associated with an element.

Parameters
altString value to be set for the struct element id.
Returns
true if optaining the font state was succsessfull, false otherwise.

◆ SetLang()

virtual bool PdsStructElement::SetLang ( const wchar_t *  alt)
pure virtual

Sets the Lang entry of a struct element.

Parameters
altString value to be set for the struct element Lang.
Returns
true if optaining the font state was succsessfull, false otherwise.

◆ SetParent()

virtual bool PdsStructElement::SetParent ( PdsStructElement parent,
int  index 
)
pure virtual

Moves the current structure element.

Parameters
parentA new parent of the structure element.
indexPosition where the element is inserted into parents kids. If parent element currently has no kids, index is ignored.
Returns
true if element was successfully moved, false otherwise.

◆ SetTitle()

virtual bool PdsStructElement::SetTitle ( const wchar_t *  title)
pure virtual

Sets the title associated with an element.

Parameters
titleString value to be set for the specific Info dictionary entry.
Returns
true if optaining the font state was succsessfull, false otherwise.

◆ SetType()

virtual bool PdsStructElement::SetType ( const wchar_t *  type)
pure virtual

Sets the struct element type.

Parameters
typeThe name representing the element's type.
Returns
true if optaining the font state was succsessfull, false otherwise.