Loading...
Searching...
No Matches
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
Element.h
Image.h
Matrix2D.h
PDFDoc.h
Page.h
Shading.h
ShapedText.h
pdftron::Common::Matrix2D
Definition Matrix2D.h:104
pdftron::PDF::ElementBuilder::PathBegin
void PathBegin()
pdftron::PDF::ElementBuilder::MoveTo
void MoveTo(double x, double y)
pdftron::PDF::ElementBuilder::CreatePath
Element CreatePath(const double *points, int point_count, const char *seg_types, int seg_types_count)
pdftron::PDF::ElementBuilder::Rect
void Rect(double x, double y, double width, double height)
pdftron::PDF::ElementBuilder::CreateImage
Element CreateImage(Image &img, double x, double y, double hscale, double vscale)
pdftron::PDF::ElementBuilder::CreateShapedTextRun
Element CreateShapedTextRun(ShapedText text_data)
pdftron::PDF::ElementBuilder::CreateTextRun
Element CreateTextRun(const UChar *text_data, UInt32 text_data_sz, Font font, double font_sz)
pdftron::PDF::ElementBuilder::CreateTextRun
Element CreateTextRun(const char *text_data, UInt32 text_data_sz)
pdftron::PDF::ElementBuilder::CreateEllipse
Element CreateEllipse(double x, double y, double width, double height)
pdftron::PDF::ElementBuilder::PathEnd
Element PathEnd()
pdftron::PDF::ElementBuilder::CreateUnicodeTextRun
Element CreateUnicodeTextRun(const Unicode *text_data, UInt32 text_data_sz)
pdftron::PDF::ElementBuilder::CreateMarkedContentBeginInlineProperties
Element CreateMarkedContentBeginInlineProperties(const char *tag)
pdftron::PDF::ElementBuilder::CreateTextEnd
Element CreateTextEnd()
pdftron::PDF::ElementBuilder::ElementBuilder
ElementBuilder()
pdftron::PDF::ElementBuilder::CurveTo
void CurveTo(double cx1, double cy1, double cx2, double cy2, double x2, double y2)
pdftron::PDF::ElementBuilder::CreateTextNewLine
Element CreateTextNewLine()
pdftron::PDF::ElementBuilder::CreateTextNewLine
Element CreateTextNewLine(double dx, double dy)
pdftron::PDF::ElementBuilder::LineTo
void LineTo(double x, double y)
pdftron::PDF::ElementBuilder::ClosePath
void ClosePath()
pdftron::PDF::ElementBuilder::CreateTextRun
Element CreateTextRun(const UChar *text_data, UInt32 text_data_sz)
pdftron::PDF::ElementBuilder::CreateTextRun
Element CreateTextRun(const char *text_data, UInt32 text_data_sz, Font font, double font_sz)
pdftron::PDF::ElementBuilder::CreateGroupEnd
Element CreateGroupEnd()
pdftron::PDF::ElementBuilder::CreateGroupBegin
Element CreateGroupBegin()
pdftron::PDF::ElementBuilder::CreateTextRun
Element CreateTextRun(const char *text_data, Font font, double font_sz)
pdftron::PDF::ElementBuilder::Reset
void Reset(GState gs=0)
pdftron::PDF::ElementBuilder::Destroy
void Destroy()
pdftron::PDF::ElementBuilder::CreateTextBegin
Element CreateTextBegin(Font font, double font_sz)
pdftron::PDF::ElementBuilder::CreateMarkedContentEnd
Element CreateMarkedContentEnd()
pdftron::PDF::ElementBuilder::CreateForm
Element CreateForm(Page page, class PDFDoc &doc)
pdftron::PDF::ElementBuilder::CreateRect
Element CreateRect(double x, double y, double width, double height)
pdftron::PDF::ElementBuilder::CreateForm
Element CreateForm(SDF::Obj form)
pdftron::PDF::ElementBuilder::CreateForm
Element CreateForm(Page page)
pdftron::PDF::ElementBuilder::Ellipse
void Ellipse(double x, double y, double width, double height)
pdftron::PDF::ElementBuilder::~ElementBuilder
~ElementBuilder()
pdftron::PDF::ElementBuilder::CreateTextBegin
Element CreateTextBegin()
pdftron::PDF::ElementBuilder::CreateShading
Element CreateShading(Shading &sh)
pdftron::PDF::ElementBuilder::CreateMarkedContentPoint
Element CreateMarkedContentPoint(const char *tag, SDF::Obj property_dict)
pdftron::PDF::ElementBuilder::CreatePath
Element CreatePath(const std::vector< double > &points, const std::vector< unsigned char > &seg_types)
pdftron::PDF::ElementBuilder::ArcTo
void ArcTo(double xr, double yr, double rx, bool isLargeArc, bool sweep, double endX, double endY)
pdftron::PDF::ElementBuilder::CreateMarkedContentBegin
Element CreateMarkedContentBegin(const char *tag, SDF::Obj property_dict)
pdftron::PDF::ElementBuilder::CreateImage
Element CreateImage(Image &img)
pdftron::PDF::ElementBuilder::CreateTextRun
Element CreateTextRun(const char *text_data)
pdftron::PDF::ElementBuilder::CreateImage
Element CreateImage(Image &img, const Common::Matrix2D &mtx)
pdftron::PDF::ElementBuilder::ArcTo
void ArcTo(double x, double y, double width, double height, double start, double extent)
pdftron::PDF::ElementBuilder::CreateMarkedContentPointInlineProperties
Element CreateMarkedContentPointInlineProperties(const char *tag)
pdftron::PDF::Element
Definition Element.h:33
pdftron::PDF::Font
Definition Font.h:56
pdftron::PDF::GState
Definition GState.h:27
pdftron::PDF::Image
Definition Image.h:23
pdftron::PDF::PDFDoc
Definition PDFDoc.h:72
pdftron::PDF::Page
Definition Page.h:32
pdftron::PDF::Shading
Definition Shading.h:61
pdftron::PDF::ShapedText
Definition ShapedText.h:24
pdftron::SDF::Obj
Definition Obj.h:41
pdftron::PDF
Definition Action.h:15
pdftron
Definition BasicTypes.h:10
pdftron::UInt32
TRN_UInt32 UInt32
Definition BasicTypes.h:13
pdftron::UChar
TRN_UChar UChar
Definition BasicTypes.h:12
pdftron::Unicode
TRN_Unicode Unicode
Definition BasicTypes.h:22