- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ElementBuilder.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_CPPPDFElementBuilder
6 #define PDFTRON_H_CPPPDFElementBuilder
7
8 #include <PDF/Page.h>
9 #include <PDF/Element.h>
10 #include <Common/Matrix2D.h>
11 #include <PDF/Image.h>
12 #include <PDF/Shading.h>
13 #include <PDF/PDFDoc.h>
14 #include <PDF/ShapedText.h>
15 #include <C/PDF/TRN_ElementBuilder.h>
16
17 namespace pdftron {
18 namespace PDF {
19
20
33 class ElementBuilder
34 {
35 public:
36
37 ElementBuilder();
38 ~ElementBuilder();
39
56 void Reset(GState gs = 0);
57
58 // Image Element ------------------------------------------------
59
64 Element CreateImage(Image& img);
65
71 Element CreateImage(Image& img, const Common::Matrix2D& mtx);
72
82 Element CreateImage(Image& img, double x, double y, double hscale, double vscale);
83
88 Element CreateGroupBegin();
89
94 Element CreateGroupEnd();
95
101 Element CreateShading(Shading& sh);
102
107 Element CreateForm(SDF::Obj form);
108
117 Element CreateForm(Page page);
118
127 Element CreateForm(Page page, class PDFDoc& doc);
128
135 Element CreateTextBegin(Font font, double font_sz);
136
140 Element CreateTextBegin();
141
145 Element CreateTextEnd();
146
151 Element CreateTextRun(const char* text_data, Font font, double font_sz);
152 #ifndef SWIG
153 Element CreateTextRun(const char* text_data, UInt32 text_data_sz, Font font, double font_sz);
154 Element CreateTextRun(const UChar* text_data, UInt32 text_data_sz, Font font, double font_sz);
155 #endif
156
162 Element CreateTextRun(const char* text_data);
163 #ifndef SWIG
164 Element CreateTextRun(const char* text_data, UInt32 text_data_sz);
165 Element CreateTextRun(const UChar* text_data, UInt32 text_data_sz);
166 #endif
167
179 Element CreateUnicodeTextRun(const Unicode* text_data, UInt32 text_data_sz);
180
195 Element CreateShapedTextRun(ShapedText text_data);
196
206 Element CreateTextNewLine(double dx, double dy);
207
212 Element CreateTextNewLine();
213
214 // Path Element -------------------------------------------------
215
220 Element CreatePath(const std::vector<double>& points, const std::vector<unsigned char>& seg_types);
221
222 #ifndef SWIG
223 Element CreatePath(const double* points, int point_count, const char* seg_types, int seg_types_count);
224 #endif
225
235 Element CreateRect(double x, double y, double width, double height);
236
246 Element CreateEllipse(double x, double y, double width, double height);
247
252 void PathBegin();
253
258 Element PathEnd();
259
265 void MoveTo(double x, double y);
266
272 void LineTo(double x, double y);
273
284 void CurveTo(double cx1, double cy1, double cx2, double cy2, double x2, double y2);
285
296 void ArcTo(double x, double y, double width, double height, double start, double extent);
297
314 void ArcTo(double xr, double yr,
315 double rx,
316 bool isLargeArc,
317 bool sweep,
318 double endX, double endY);
319
329 void Ellipse(double x, double y, double width, double height);
330
340 void Rect(double x, double y, double width, double height);
341
345 void ClosePath();
346
354 Element CreateMarkedContentBeginInlineProperties(const char* tag);
355
363 Element CreateMarkedContentBegin(const char* tag, SDF::Obj property_dict);
364
370 Element CreateMarkedContentEnd();
371
379 Element CreateMarkedContentPointInlineProperties(const char* tag);
380
388 Element CreateMarkedContentPoint(const char* tag, SDF::Obj property_dict);
389
393 void Destroy();
394
395 // @cond PRIVATE_DOC
396 #ifndef SWIGHIDDEN
397 TRN_ElementBuilder mp_builder;
398 #endif
399 private:
400 // ElementBuilder should not be copied
401 ElementBuilder(const ElementBuilder&);
402 ElementBuilder& operator= (const ElementBuilder&);
403 // @endcond
404 };
405
406
407 #include <Impl/ElementBuilder.inl>
408
409 }; // namespace PDF
410 }; // namespace pdftron
411
412
413 #endif // PDFTRON_H_CPPPDFElementBuilder
pdftron::PDF::ElementBuilder::MoveTo
void MoveTo(double x, double y)
pdftron::PDF::ElementBuilder::CreateMarkedContentPoint
Element CreateMarkedContentPoint(const char *tag, SDF::Obj property_dict)
pdftron::PDF::ElementBuilder::CreateShapedTextRun
Element CreateShapedTextRun(ShapedText text_data)
pdftron::PDF::ElementBuilder::CreateImage
Element CreateImage(Image &img)
pdftron::PDF::ElementBuilder::CreateEllipse
Element CreateEllipse(double x, double y, double width, double height)
pdftron::PDF::ShapedText
Definition: ShapedText.h:23
pdftron::PDF::Image
Definition: Image.h:22
pdftron::PDF::ElementBuilder::CreateTextRun
Element CreateTextRun(const char *text_data, Font font, double font_sz)
Shading.h
pdftron::PDF::ElementBuilder::PathBegin
void PathBegin()
pdftron::PDF::Shading
Definition: Shading.h:60
pdftron::PDF::ElementBuilder::CreateGroupEnd
Element CreateGroupEnd()
pdftron::PDF::GState
Definition: GState.h:26
pdftron::PDF::ElementBuilder::CreateMarkedContentPointInlineProperties
Element CreateMarkedContentPointInlineProperties(const char *tag)
Matrix2D.h
pdftron::PDF::ElementBuilder::PathEnd
Element PathEnd()
pdftron::PDF::ElementBuilder::CreateForm
Element CreateForm(SDF::Obj form)
pdftron::PDF::ElementBuilder::CreateTextEnd
Element CreateTextEnd()
pdftron::PDF::ElementBuilder::CurveTo
void CurveTo(double cx1, double cy1, double cx2, double cy2, double x2, double y2)
pdftron::PDF::ElementBuilder::ClosePath
void ClosePath()
pdftron::PDF::ElementBuilder::CreateRect
Element CreateRect(double x, double y, double width, double height)
pdftron::Unicode
TRN_Unicode Unicode
Definition: BasicTypes.h:22
Element.h
pdftron::PDF::ElementBuilder::CreateTextBegin
Element CreateTextBegin()
pdftron::PDF::ElementBuilder::ElementBuilder
ElementBuilder()
pdftron::PDF::ElementBuilder::CreateMarkedContentBegin
Element CreateMarkedContentBegin(const char *tag, SDF::Obj property_dict)
pdftron::PDF::ElementBuilder::CreateMarkedContentEnd
Element CreateMarkedContentEnd()
ShapedText.h
pdftron::PDF::PDFDoc
Definition: PDFDoc.h:71
pdftron::UInt32
TRN_UInt32 UInt32
Definition: BasicTypes.h:13
pdftron::Common::Matrix2D
Definition: Matrix2D.h:103
pdftron::PDF::ElementBuilder::~ElementBuilder
~ElementBuilder()
pdftron::PDF::ElementBuilder::LineTo
void LineTo(double x, double y)
pdftron::UChar
TRN_UChar UChar
Definition: BasicTypes.h:12
pdftron::PDF::Font
Definition: Font.h:55
pdftron::PDF::ElementBuilder::Destroy
void Destroy()
PDFDoc.h
Image.h
pdftron::PDF::ElementBuilder::CreateMarkedContentBeginInlineProperties
Element CreateMarkedContentBeginInlineProperties(const char *tag)
pdftron::PDF::ElementBuilder::CreateGroupBegin
Element CreateGroupBegin()
pdftron::PDF::ElementBuilder::CreatePath
Element CreatePath(const std::vector< double > &points, const std::vector< unsigned char > &seg_types)
pdftron::PDF::Page
Definition: Page.h:31
pdftron::PDF::ElementBuilder::Ellipse
void Ellipse(double x, double y, double width, double height)
Page.h
pdftron::PDF::ElementBuilder::Reset
void Reset(GState gs=0)
pdftron::PDF::ElementBuilder
Definition: ElementBuilder.h:33
pdftron::PDF::Element
Definition: Element.h:32
pdftron::PDF::ElementBuilder::CreateTextNewLine
Element CreateTextNewLine()
pdftron::SDF::Obj
Definition: Obj.h:40
pdftron::PDF::ElementBuilder::Rect
void Rect(double x, double y, double width, double height)
pdftron::PDF::ElementBuilder::CreateUnicodeTextRun
Element CreateUnicodeTextRun(const Unicode *text_data, UInt32 text_data_sz)
pdftron::PDF::ElementBuilder::ArcTo
void ArcTo(double x, double y, double width, double height, double start, double extent)
pdftron::PDF::ElementBuilder::CreateShading
Element CreateShading(Shading &sh)