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
00178 Rect GetBoundingBox() const;
00179
00183 enum Rotate
00184 {
00185 e_0,
00186 e_90,
00187 e_180,
00188 e_270
00189 };
00190
00191
00195 Rotate GetRotation() const;
00196
00203 void SetRotation(Rotate angle);
00204
00211 double GetPageWidth(Box box_type = e_crop);
00212
00219 double GetPageHeight(Box box_type = e_crop);
00220
00236 Common::Matrix2D GetDefaultMatrix(bool flip_y = false, Box box_type = e_crop, Rotate angle = e_0) const;
00237
00245 SDF::Obj GetAnnots() const;
00246
00253 UInt32 GetNumAnnots() const;
00254
00264 Annot GetAnnot(UInt32 index) const;
00265
00274 void AnnotInsert(UInt32 pos, Annot& annot);
00275
00280 void AnnotPushBack(Annot& annot);
00281
00286 void AnnotPushFront(Annot& annot);
00287
00293 void AnnotRemove(Annot& annot);
00294
00300 void AnnotRemove(UInt32 index);
00301
00314 void Scale(double scale);
00315
00329 void FlattenField(class Field filed);
00330
00334 bool HasTransition() const;
00335
00343 double GetUserUnitSize() const;
00344
00354 void SetUserUnitSize(double unit_size);
00355
00360 SDF::Obj GetResourceDict () const;
00361
00365 SDF::Obj GetContents () const;
00366
00372 SDF::Obj GetSDFObj () const;
00373
00392 SDF::Obj FindInheritedAttribute (const char* attrib) const;
00393
00394
00398 operator bool () { return IsValid();}
00399
00400
00401
00403 Page(TRN_Page impl);
00404 TRN_Page mp_page;
00406 };
00407
00408
00409 };
00410 };
00411 #include <Impl/Page.inl>
00412 #endif
00413