00001
00002
00003
00004
00005
00006 #ifndef H_CPPPDFElementBuilder
00007 #define H_CPPPDFElementBuilder
00008
00009 #include <PDF/Page.h>
00010 #include <PDF/Element.h>
00011 #include <Common/Matrix2D.h>
00012 #include <PDF/Image.h>
00013 #include <PDF/Shading.h>
00014 #include <PDF/PDFDoc.h>
00015 #include <C/PDF/TRN_ElementBuilder.h>
00016
00017 namespace pdftron {
00018 namespace PDF {
00019
00020
00033 class ElementBuilder
00034 {
00035 public:
00036
00037 ElementBuilder();
00038 ~ElementBuilder();
00039
00055 void Reset(GState gs = 0);
00056
00057
00058
00062 Element CreateImage(Image& img);
00063
00068 Element CreateImage(Image& img, const Common::Matrix2D& mtx);
00069
00074 Element CreateImage(Image& img, double x, double y, double hscale, double vscale);
00075
00080 Element CreateGroupBegin();
00081
00086 Element CreateGroupEnd();
00087
00091 Element CreateShading(Shading& sh);
00092
00097 Element CreateForm(SDF::Obj form);
00098
00107 Element CreateForm(Page page);
00108
00117 Element CreateForm(Page page, class PDFDoc& doc);
00118
00123 Element CreateTextBegin(Font font, double font_sz);
00124
00128 Element CreateTextBegin();
00129
00133 Element CreateTextEnd();
00134
00139 Element CreateTextRun(const char* text_data, Font font, double font_sz);
00140 Element CreateTextRun(const char* text_data, UInt32 text_data_sz, Font font, double font_sz);
00141 Element CreateTextRun(const UChar* text_data, UInt32 text_data_sz, Font font, double font_sz);
00142
00148 Element CreateTextRun(const char* text_data);
00149 Element CreateTextRun(const char* text_data, UInt32 text_data_sz);
00150 Element CreateTextRun(const UChar* text_data, UInt32 text_data_sz);
00151
00163 Element CreateUnicodeTextRun(const Unicode* text_data, UInt32 text_data_sz);
00164
00171 Element CreateTextNewLine(double dx, double dy);
00172
00176 Element CreateTextNewLine();
00177
00178
00179
00183 Element CreatePath(const double* points, int point_count, const char* seg_types, int seg_types_count);
00184
00191 Element CreateRect(double x, double y, double width, double height);
00192
00199 Element CreateEllipse(double cx, double cy, double rx, double ry);
00200
00205 void PathBegin();
00206
00211 Element PathEnd();
00212
00216 void MoveTo(double x, double y);
00217
00221 void LineTo(double x, double y);
00222
00227 void CurveTo(double cx1, double cy1, double cx2, double cy2, double x2, double y2);
00228
00237 void ArcTo(double x, double y, double width, double height, double start, double extent);
00238
00253 void ArcTo(double xr, double yr,
00254 double rx,
00255 bool isLargeArc,
00256 bool sweep,
00257 double endX, double endY);
00258
00266 void Ellipse(double cx, double cy, double rx, double ry);
00267
00275 void Rect(double x, double y, double width, double height);
00276
00280 void ClosePath();
00281
00283 TRN_ElementBuilder mp_builder;
00285 };
00286
00287
00288 #include <Impl/ElementBuilder.inl>
00289
00290 };
00291 };
00292
00293
00294 #endif
00295