#include <SElement.h>
Public Member Functions | |
SElement (SDF::Obj dict=SDF::Obj(0)) | |
SElement (const SElement &) | |
SElement & | operator= (const SElement &) |
void | Insert (SElement &kid, int insert_before) |
int | CreateContentItem (PDFDoc &doc, Page &page, int insert_before=-1) |
bool | IsValid () const |
const char * | GetType () const |
int | GetNumKids () const |
bool | IsContentItem (int index) const |
class ContentItem | GetAsContentItem (int index) const |
SElement | GetAsStructElem (int index) const |
SElement | GetParent () const |
class STree | GetStructTreeRoot () const |
bool | HasTitle () const |
UString | GetTitle () const |
SDF::Obj | GetID () const |
bool | HasActualText () const |
UString | GetActualText () const |
bool | HasAlt () const |
UString | GetAlt () const |
SDF::Obj | GetSDFObj () const |
Static Public Member Functions | |
static SElement | Create (pdftron::PDF::PDFDoc &doc, const char *struct_type) |
SElement represents PDF structural elements, which are nodes in a tree structure, defining a PDF document's logical structure.
Unlike the StructTree, SElement can have two different kinds of children: another SElement or a ContentItem (which can be marked content (MC), or a PDF object reference (OBJR)).
Definition at line 21 of file SElement.h.
Initialize a SElement using an existing low-level Cos/SDF object.
dict | - a low-level (SDF/Cos) dictionary representing the structural element. |
pdftron::PDF::Struct::SElement::SElement | ( | const SElement & | ) |
|
static |
Creates a new SElement.
doc | |
struct_type |
int pdftron::PDF::Struct::SElement::CreateContentItem | ( | PDFDoc & | doc, |
Page & | page, | ||
int | insert_before = -1 |
||
) |
doc | The document in which the new ContentItem will be created in. |
page | The page object to insert the ContentItem in. |
insert_before | The position after which the kid is inserted. If element currently has no kids, insert_before is ignored. |
UString pdftron::PDF::Struct::SElement::GetActualText | ( | ) | const |
UString pdftron::PDF::Struct::SElement::GetAlt | ( | ) | const |
class ContentItem pdftron::PDF::Struct::SElement::GetAsContentItem | ( | int | index | ) | const |
index | The index of the kid to obtain. |
SElement pdftron::PDF::Struct::SElement::GetAsStructElem | ( | int | index | ) | const |
index | The index of the kid to obtain. |
SDF::Obj pdftron::PDF::Struct::SElement::GetID | ( | ) | const |
int pdftron::PDF::Struct::SElement::GetNumKids | ( | ) | const |
SElement pdftron::PDF::Struct::SElement::GetParent | ( | ) | const |
SDF::Obj pdftron::PDF::Struct::SElement::GetSDFObj | ( | ) | const |
class STree pdftron::PDF::Struct::SElement::GetStructTreeRoot | ( | ) | const |
UString pdftron::PDF::Struct::SElement::GetTitle | ( | ) | const |
const char* pdftron::PDF::Struct::SElement::GetType | ( | ) | const |
The type identifies the nature of the structure element and its role within the document (such as a chapter, paragraph, or footnote).
bool pdftron::PDF::Struct::SElement::HasActualText | ( | ) | const |
ActualText is an exact replacement for the structure element and its children. This replacement text is useful when extracting the document's contents in support of accessibility to users with disabilities or for other purposes.
bool pdftron::PDF::Struct::SElement::HasAlt | ( | ) | const |
Alt text is an alternate description of the structure element and its children in human-readable form, which is useful when extracting the document's contents in support of accessibility.
bool pdftron::PDF::Struct::SElement::HasTitle | ( | ) | const |
The title of the structure element, a text string representing it in human-readable form.
void pdftron::PDF::Struct::SElement::Insert | ( | SElement & | kid, |
int | insert_before | ||
) |
Inserts the specified kid SElement into this element.
insert_before | The position after which the kid is inserted. If element currently has no kids, insert_before is ignored. |
bool pdftron::PDF::Struct::SElement::IsContentItem | ( | int | index | ) | const |
index | The index of the kid type to obtain. |
To retrieve a content item at a given array index use GetAsContentItem(index), otherwise use GetAsStructElem(index)
bool pdftron::PDF::Struct::SElement::IsValid | ( | ) | const |