00001
00002
00003
00004
00005
00006 #ifndef PDFRasterizer_H
00007 #define PDFRasterizer_H
00008
00009 #include <PDF/Page.h>
00010 #include <C/PDF/TRN_PDFRasterizer.h>
00011 #include <PDF/OCG/Context.h>
00012 #ifdef SWIG
00013 #include <PDF/Callback.h>
00014 #endif
00015
00016 namespace pdftron {
00017 namespace PDF {
00018
00030 class PDFRasterizer
00031 {
00032 public:
00033
00047 enum Type {
00048 e_BuiltIn,
00049 e_GDIPlus
00050 };
00051
00058 enum OverprintPreviewMode {
00059 e_op_off = 0,
00060 e_op_on,
00061 e_op_pdfx_on
00062 };
00063
00067 PDFRasterizer(Type type = e_BuiltIn);
00068 ~PDFRasterizer();
00069
00123 std::vector<unsigned char> Rasterize(Page& page,
00124 int width, int height, int stride,
00125 int num_comps, bool demult,
00126 const Common::Matrix2D& device_mtx,
00127 const Rect* clip = 0,
00128 const Rect* scrl_clp_regions = 0,
00129 volatile bool* cancel = 0);
00130
00131 #ifndef SWIG
00132 void Rasterize(Page& page, UChar* in_out_image_buffer,
00133 int width, int height, int stride,
00134 int num_comps, bool demult,
00135 const Common::Matrix2D& device_mtx,
00136 const Rect* clip = 0,
00137 const Rect* scrl_clp_regions = 0,
00138 volatile bool* cancel = 0);
00139 #endif
00140
00166 #ifdef _WIN32
00167 void Rasterize(Page& page, void* hdc,
00168 const Common::Matrix2D& device_mtx,
00169 const Rect* clip = 0,
00170 int dpi = -1,
00171 volatile bool* cancel = 0);
00172 #endif
00173
00179 void SetDrawAnnotations(bool render_annots);
00180
00186 void SetHighlightFields(bool highlight_fields);
00187
00197 void SetAntiAliasing(bool enable_aa);
00198
00207 void SetPathHinting(bool path_hinting);
00208
00219 void SetThinLineAdjustment(bool pixel_grid_fit, bool stroke_adjust);
00220
00234 void SetImageSmoothing(bool smoothing_enabled = true);
00235
00242 void SetCaching(bool enabled = true);
00243
00256 void SetGamma(double exp);
00257
00267 void SetOCGContext(OCG::Context* ctx);
00268
00278 void SetPrintMode(bool is_printing);
00279
00289 void SetOverprint(OverprintPreviewMode op);
00290
00296 typedef void (*ErrorReportProc) (const char* message, void* data);
00297
00305 #ifdef SWIG
00306 void SetErrorReportProc(Callback* instance);
00307 #else
00308 void SetErrorReportProc(ErrorReportProc error_proc, void* data);
00309 #endif
00310
00319 void SetRasterizerType (Type type);
00320
00324 Type GetRasterizerType ();
00325
00329 void Destroy();
00330
00332 #ifndef SWIGHIDDEN
00333 TRN_PDFRasterizer mp_rast;
00334 #endif
00336 };
00337
00338
00339 #include <Impl/PDFRasterizer.inl>
00340
00341
00342 };
00343 };
00344
00345 #endif
00346
00347
00348