All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SElement.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------------------
2 // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3 // Consult legal.txt regarding legal and license information.
4 //---------------------------------------------------------------------------------------
5 #ifndef PDFTRON_H_CPPPDFStructSElement
6 #define PDFTRON_H_CPPPDFStructSElement
7 
8 namespace pdftron {
9  namespace PDF {
10  class PDFDoc;
11  namespace Struct {
12  class STree;
13 
22 class SElement
23 {
24 public:
25 
34  SElement (SDF::Obj dict = SDF::Obj(0));
35 
36  SElement (const SElement&);
37  SElement& operator= (const SElement&);
38 
44  static SElement Create(pdftron::PDF::PDFDoc& doc, const char* struct_type);
45 
52  void Insert(SElement& kid, int insert_before);
53 
60  int CreateContentItem(PDFDoc& doc, Page& page, int insert_before = -1);
61 
65  bool IsValid() const;
66 
74  const char* GetType() const;
75 
79  int GetNumKids() const;
80 
89  bool IsContentItem(int index) const;
90 
97  class ContentItem GetAsContentItem(int index) const;
98 
105  SElement GetAsStructElem(int index) const;
106 
115  SElement GetParent() const;
116 
121  class STree GetStructTreeRoot() const;
122 
129  bool HasTitle() const;
130 
134  UString GetTitle() const;
135 
139  SDF::Obj GetID() const;
140 
148  bool HasActualText() const;
149 
157  UString GetActualText() const;
158 
166  bool HasAlt() const;
167 
175  UString GetAlt() const;
176 
180  SDF::Obj GetSDFObj() const;
181 
182 
183 // @cond PRIVATE_DOC
184 #ifndef SWIGHIDDEN
185  SElement(TRN_SElement impl);
186  TRN_SElement mp_elem;
187 #endif
188 // @endcond
189 };
190 
191 
192 
193  }; // namespace Struct
194  }; // namespace PDF
195 }; // namespace pdftron
196 
197 #include <Impl/PDFDoc.inl>
198 
199 #endif // PDFTRON_H_CPPPDFStructSElement
SElement(SDF::Obj dict=SDF::Obj(0))
bool IsContentItem(int index) const
int CreateContentItem(PDFDoc &doc, Page &page, int insert_before=-1)
UString GetActualText() const
const char * GetType() const
SElement GetAsStructElem(int index) const
static SElement Create(pdftron::PDF::PDFDoc &doc, const char *struct_type)
SElement & operator=(const SElement &)
void Insert(SElement &kid, int insert_before)