1 //========================================================================
5 // Copyright 1996 Derek B. Noonburg
7 //========================================================================
22 //------------------------------------------------------------------------
24 //------------------------------------------------------------------------
29 // Construct a new PageAttrs object by merging a dictionary
30 // (of type Pages or Page) into another PageAttrs object. If
31 // <attrs> is NULL, uses defaults.
32 PageAttrs(PageAttrs *attrs, Dict *dict);
38 double getX1() { return limitToCropBox ? cropX1 : x1; }
39 double getY1() { return limitToCropBox ? cropY1 : y1; }
40 double getX2() { return limitToCropBox ? cropX2 : x2; }
41 double getY2() { return limitToCropBox ? cropY2 : y2; }
42 GBool isCropped() { return cropX2 > cropX1; }
43 double getCropX1() { return cropX1; }
44 double getCropY1() { return cropY1; }
45 double getCropX2() { return cropX2; }
46 double getCropY2() { return cropY2; }
47 int getRotate() { return rotate; }
48 Dict *getResourceDict()
49 { return resources.isDict() ? resources.getDict() : (Dict *)NULL; }
53 double x1, y1, x2, y2;
54 double cropX1, cropY1, cropX2, cropY2;
60 //------------------------------------------------------------------------
62 //------------------------------------------------------------------------
68 Page(int num1, Dict *pageDict, PageAttrs *attrs1);
74 GBool isOk() { return ok; }
76 // Get page parameters.
77 double getX1() { return attrs->getX1(); }
78 double getY1() { return attrs->getY1(); }
79 double getX2() { return attrs->getX2(); }
80 double getY2() { return attrs->getY2(); }
81 GBool isCropped() { return attrs->isCropped(); }
82 double getCropX1() { return attrs->getCropX1(); }
83 double getCropY1() { return attrs->getCropY1(); }
84 double getCropX2() { return attrs->getCropX2(); }
85 double getCropY2() { return attrs->getCropY2(); }
86 double getWidth() { return attrs->getX2() - attrs->getX1(); }
87 double getHeight() { return attrs->getY2() - attrs->getY1(); }
88 int getRotate() { return attrs->getRotate(); }
91 Dict *getResourceDict() { return attrs->getResourceDict(); }
93 // Get annotations array.
94 Object *getAnnots(Object *obj) { return annots.fetch(obj); }
97 Object *getContents(Object *obj) { return contents.fetch(obj); }
100 void display(OutputDev *out, int dpi, int rotate);
104 int num; // page number
105 PageAttrs *attrs; // page attributes
106 Object annots; // annotations array
107 Object contents; // page contents
108 GBool ok; // true if page is valid