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-2018 by PDFTron Systems 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 <C/PDF/TRN_ElementBuilder.h>
15 
16 namespace pdftron {
17  namespace PDF {
18 
19 
33 {
34 public:
35 
38 
55  void Reset(GState gs = 0);
56 
57  // Image Element ------------------------------------------------
58 
64 
70  Element CreateImage(Image& img, const Common::Matrix2D& mtx);
71 
81  Element CreateImage(Image& img, double x, double y, double hscale, double vscale);
82 
88 
94 
101 
107 
116  Element CreateForm(Page page);
117 
126  Element CreateForm(Page page, class PDFDoc& doc);
127 
134  Element CreateTextBegin(Font font, double font_sz);
135 
140 
145 
150  Element CreateTextRun(const char* text_data, Font font, double font_sz);
151 #ifndef SWIG
152  Element CreateTextRun(const char* text_data, UInt32 text_data_sz, Font font, double font_sz);
153  Element CreateTextRun(const UChar* text_data, UInt32 text_data_sz, Font font, double font_sz);
154 #endif
155 
161  Element CreateTextRun(const char* text_data);
162 #ifndef SWIG
163  Element CreateTextRun(const char* text_data, UInt32 text_data_sz);
164  Element CreateTextRun(const UChar* text_data, UInt32 text_data_sz);
165 #endif
166 
178  Element CreateUnicodeTextRun(const Unicode* text_data, UInt32 text_data_sz);
179 
189  Element CreateTextNewLine(double dx, double dy);
190 
196 
197  // Path Element -------------------------------------------------
198 
203  Element CreatePath(const std::vector<double>& points, const std::vector<unsigned char>& seg_types);
204 
205 #ifndef SWIG
206  Element CreatePath(const double* points, int point_count, const char* seg_types, int seg_types_count);
207 #endif
208 
218  Element CreateRect(double x, double y, double width, double height);
219 
229  Element CreateEllipse(double x, double y, double width, double height);
230 
235  void PathBegin();
236 
241  Element PathEnd();
242 
248  void MoveTo(double x, double y);
249 
255  void LineTo(double x, double y);
256 
267  void CurveTo(double cx1, double cy1, double cx2, double cy2, double x2, double y2);
268 
279  void ArcTo(double x, double y, double width, double height, double start, double extent);
280 
297  void ArcTo(double xr, double yr,
298  double rx,
299  bool isLargeArc,
300  bool sweep,
301  double endX, double endY);
302 
312  void Ellipse(double x, double y, double width, double height);
313 
323  void Rect(double x, double y, double width, double height);
324 
328  void ClosePath();
329 
333  void Destroy();
334 
336 #ifndef SWIGHIDDEN
337  TRN_ElementBuilder mp_builder;
338 #endif
339 private:
340  // ElementBuilder should not be copied
342  ElementBuilder& operator= (const ElementBuilder&);
344 };
345 
346 
347 #include <Impl/ElementBuilder.inl>
348 
349  }; // namespace PDF
350 }; // namespace pdftron
351 
352 
353 #endif // PDFTRON_H_CPPPDFElementBuilder
void MoveTo(double x, double y)
Element CreateImage(Image &img)
Element CreateEllipse(double x, double y, double width, double height)
Element CreateTextRun(const char *text_data, Font font, double font_sz)
Element CreateForm(SDF::Obj form)
void CurveTo(double cx1, double cy1, double cx2, double cy2, double x2, double y2)
Element CreateRect(double x, double y, double width, double height)
TRN_Unicode Unicode
Definition: BasicTypes.h:22
TRN_UInt32 UInt32
Definition: BasicTypes.h:13
void LineTo(double x, double y)
TRN_UChar UChar
Definition: BasicTypes.h:12
Element CreatePath(const std::vector< double > &points, const std::vector< unsigned char > &seg_types)
void Ellipse(double x, double y, double width, double height)
void Rect(double x, double y, double width, double height)
Element CreateUnicodeTextRun(const Unicode *text_data, UInt32 text_data_sz)
void ArcTo(double x, double y, double width, double height, double start, double extent)
Element CreateShading(Shading &sh)

© 2002-2014 PDFTron Systems Inc.