00001
00002
00003
00004
00005
00006 #ifndef H_CPPPDFDraw
00007 #define H_CPPPDFDraw
00008
00009 #include <PDF/PDFRasterizer.h>
00010 #include <C/PDF/TRN_PDFDraw.h>
00011
00013 #if defined(_WIN32) && !defined(WINCE)
00014
00015 namespace Gdiplus { class Bitmap; };
00016 #endif
00018
00019
00020
00021 namespace pdftron {
00022 namespace PDF {
00023
00031 class PDFDraw
00032 {
00033 public:
00034
00042 PDFDraw(double dpi = 92);
00043 ~PDFDraw();
00044
00053 void SetRasterizerType (PDFRasterizer::Type type);
00054
00074 void SetDPI(double dpi);
00075
00088 void SetImageSize(int width, int height, bool preserve_aspect_ratio = true);
00089
00096 void SetPageBox(Page::Box region);
00097
00104 void SetFlipYAxis(bool flip_y);
00105
00115 void SetRotate(Page::Rotate r);
00116
00123 void SetDrawAnnotations(bool render_annots);
00124
00134 void SetAntiAliasing(bool enable_aa);
00135
00149 void SetImageSmoothing(bool smoothing_enabled = true);
00150
00157 void SetCaching(bool enabled = true);
00158
00171 void SetGamma(double exp);
00172
00182 void SetOCGContext(OCG::Context* ctx);
00183
00193 void SetPrintMode(bool is_printing);
00194
00209 void SetPageTransparent(bool is_transparent);
00210
00221 void SetOverprint(bool overprint);
00222
00301 void Export(Page page, const UString& filename, const char* format = "PNG", SDF::Obj encoder_params = 0);
00302
00311 #ifdef __DOTNET
00312 System::Drawing::Bitmap* GetBitmap(Page page);
00313 #endif
00314
00327 #ifdef _WIN32
00328 void DrawInRect(Page& page, void* hdc, const Rect& rect);
00329 #endif
00330
00334 enum PixelFormat {
00335 e_rgba,
00336 e_bgra,
00337 e_rgb,
00338 e_bgr,
00339 e_gray,
00340 e_gray_alpha,
00341 e_cmyk,
00342 e_rgba_demult,
00343 e_gray_alpha_demult
00344 };
00345
00367 const UChar* GetBitmap(Page page, int& out_width, int& out_height, int& out_stride, double& out_dpi, PixelFormat pix_fmt = e_bgra);
00368
00376 void SetErrorReportProc(PDFRasterizer::ErrorReportProc error_proc, void* data);
00377
00379 TRN_PDFDraw mp_draw;
00381 };
00382
00383
00384 #include <Impl/PDFDraw.inl>
00385
00386
00387 };
00388 };
00389
00390
00391 #endif
00392
00393
00394