00001
00002
00003
00004
00005
00006 #ifndef H_CPPPDFPage
00007 #define H_CPPPDFPage
00008
00009 #include <PDF/Rect.h>
00010 #include <SDF/Obj.h>
00011 #include <C/PDF/TRN_Page.h>
00012 #include <Common/Matrix2D.h>
00013
00014 namespace pdftron {
00015 namespace PDF {
00016
00017 class Annot;
00018
00030 class Page
00031 {
00032 public:
00033
00045 Page (SDF::Obj page_dict = 0);
00046
00047 Page (const Page& p);
00048 Page& operator= (const Page& p);
00049
00055 bool IsValid() const;
00056
00062 int GetIndex() const;
00063
00092 enum Box
00093 {
00094 e_media,
00095 e_crop,
00096 e_bleed,
00097 e_trim,
00098 e_art
00099 };
00100
00110 Rect GetBox(Box type) const;
00111
00120 void SetBox(Box type, const Rect& box) const;
00121
00129 Rect GetCropBox() const;
00130
00143 void SetCropBox(const Rect& box);
00144
00156 Rect GetMediaBox() const;
00157
00170 void SetMediaBox(const Rect& box);
00171
00175 enum Rotate
00176 {
00177 e_0,
00178 e_90,
00179 e_180,
00180 e_270
00181 };
00182
00186 Rotate GetRotation() const;
00187
00194 void SetRotation(Rotate angle);
00195
00202 double GetPageWidth(Box box_type = e_crop);
00203
00210 double GetPageHeight(Box box_type = e_crop);
00211
00227 Common::Matrix2D GetDefaultMatrix(bool flip_y = false, Box box_type = e_crop, Rotate angle = e_0) const;
00228
00236 SDF::Obj GetAnnots() const;
00237
00244 UInt GetNumAnnots() const;
00245
00255 Annot GetAnnot(UInt index) const;
00256
00265 void AnnotInsert(UInt pos, Annot& annot);
00266
00271 void AnnotPushBack(Annot& annot);
00272
00277 void AnnotPushFront(Annot& annot);
00278
00284 void AnnotRemove(Annot& annot);
00285
00291 void AnnotRemove(UInt index);
00292
00305 void Scale(double scale);
00306
00320 void FlattenField(class Field filed);
00321
00325 bool HasTransition() const;
00326
00334 double GetUserUnitSize() const;
00335
00345 void SetUserUnitSize(double unit_size);
00346
00351 SDF::Obj GetResourceDict () const;
00352
00356 SDF::Obj GetContents () const;
00357
00363 SDF::Obj GetSDFObj () const;
00364
00383 SDF::Obj FindInheritedAttribute (const char* attrib) const;
00384
00385
00389 operator bool () { return IsValid();}
00390
00391
00392
00394 Page(TRN_Page impl);
00395 TRN_Page mp_page;
00397 };
00398
00399
00400 };
00401 };
00402 #include <Impl/Page.inl>
00403 #endif
00404