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, UInt text_data_sz, Font font, double font_sz);
00141 Element CreateTextRun(const UChar* text_data, UInt text_data_sz, Font font, double font_sz);
00142
00148 Element CreateTextRun(const char* text_data);
00149 Element CreateTextRun(const char* text_data, UInt text_data_sz);
00150 Element CreateTextRun(const UChar* text_data, UInt text_data_sz);
00151
00160 Element CreateUnicodeTextRun(const UShort* text_data, UInt text_data_sz);
00161
00168 Element CreateTextNewLine(double dx, double dy);
00169
00173 Element CreateTextNewLine();
00174
00175
00176
00180 Element CreatePath(const double* points, int point_count, const char* seg_types, int seg_types_count);
00181
00188 Element CreateRect(double x, double y, double width, double height);
00189
00196 Element CreateEllipse(double cx, double cy, double rx, double ry);
00197
00202 void PathBegin();
00203
00208 Element PathEnd();
00209
00217 void Rect(double x, double y, double width, double height);
00218
00222 void MoveTo(double x, double y);
00223
00227 void LineTo(double x, double y);
00228
00233 void CurveTo(double cx1, double cy1, double cx2, double cy2, double x2, double y2);
00234
00243 void ArcTo(double x, double y, double width, double height, double start, double extent);
00244
00259 void ArcTo(double xr, double yr,
00260 double rx,
00261 bool isLargeArc,
00262 bool sweep,
00263 double endX, double endY);
00264
00268 void ClosePath();
00269
00271 TRN_ElementBuilder mp_builder;
00273 };
00274
00275
00276 #include <Impl/ElementBuilder.inl>
00277
00278 };
00279 };
00280
00281
00282 #endif
00283