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 x1; }
39 double getY1() { return y1; }
40 double getX2() { return x2; }
41 double getY2() { return 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;
59 //------------------------------------------------------------------------
61 //------------------------------------------------------------------------
67 Page(int num1, Dict *pageDict, PageAttrs *attrs1);
73 GBool isOk() { return ok; }
75 // Get page parameters.
76 double getX1() { return attrs->getX1(); }
77 double getY1() { return attrs->getY1(); }
78 double getX2() { return attrs->getX2(); }
79 double getY2() { return attrs->getY2(); }
80 GBool isCropped() { return attrs->isCropped(); }
81 double getCropX1() { return attrs->getCropX1(); }
82 double getCropY1() { return attrs->getCropY1(); }
83 double getCropX2() { return attrs->getCropX2(); }
84 double getCropY2() { return attrs->getCropY2(); }
85 double getWidth() { return attrs->getX2() - attrs->getX1(); }
86 double getHeight() { return attrs->getY2() - attrs->getY1(); }
87 int getRotate() { return attrs->getRotate(); }
90 Dict *getResourceDict() { return attrs->getResourceDict(); }
92 // Get annotations array.
93 Object *getAnnots(Object *obj) { return annots.fetch(obj); }
96 Object *getContents(Object *obj) { return contents.fetch(obj); }
99 void display(OutputDev *out, int dpi, int rotate);
103 int num; // page number
104 PageAttrs *attrs; // page attributes
105 Object annots; // annotations array
106 Object contents; // page contents
107 GBool ok; // true if page is valid