1 //========================================================================
5 // Copyright 1996 Derek B. Noonburg
7 //========================================================================
24 //------------------------------------------------------------------------
26 //------------------------------------------------------------------------
31 // Construct a new PageAttrs object by merging a dictionary
32 // (of type Pages or Page) into another PageAttrs object. If
33 // <attrs> is NULL, uses defaults.
34 PageAttrs(PageAttrs *attrs, Dict *dict);
40 double getX1() { return limitToCropBox ? cropX1 : x1; }
41 double getY1() { return limitToCropBox ? cropY1 : y1; }
42 double getX2() { return limitToCropBox ? cropX2 : x2; }
43 double getY2() { return limitToCropBox ? cropY2 : y2; }
44 GBool isCropped() { return cropX2 > cropX1; }
45 double getCropX1() { return cropX1; }
46 double getCropY1() { return cropY1; }
47 double getCropX2() { return cropX2; }
48 double getCropY2() { return cropY2; }
49 int getRotate() { return rotate; }
50 Dict *getResourceDict()
51 { return resources.isDict() ? resources.getDict() : (Dict *)NULL; }
55 double x1, y1, x2, y2;
56 double cropX1, cropY1, cropX2, cropY2;
62 //------------------------------------------------------------------------
64 //------------------------------------------------------------------------
70 Page(int num1, Dict *pageDict, PageAttrs *attrs1);
76 GBool isOk() { return ok; }
78 // Get page parameters.
79 double getX1() { return attrs->getX1(); }
80 double getY1() { return attrs->getY1(); }
81 double getX2() { return attrs->getX2(); }
82 double getY2() { return attrs->getY2(); }
83 GBool isCropped() { return attrs->isCropped(); }
84 double getCropX1() { return attrs->getCropX1(); }
85 double getCropY1() { return attrs->getCropY1(); }
86 double getCropX2() { return attrs->getCropX2(); }
87 double getCropY2() { return attrs->getCropY2(); }
88 double getWidth() { return attrs->getX2() - attrs->getX1(); }
89 double getHeight() { return attrs->getY2() - attrs->getY1(); }
90 int getRotate() { return attrs->getRotate(); }
92 // Get resource dictionary.
93 Dict *getResourceDict() { return attrs->getResourceDict(); }
95 // Get annotations array.
96 Object *getAnnots(Object *obj) { return annots.fetch(obj); }
99 Object *getContents(Object *obj) { return contents.fetch(obj); }
102 void display(OutputDev *out, double dpi, int rotate,
103 Links *links, Catalog *catalog);
107 int num; // page number
108 PageAttrs *attrs; // page attributes
109 Object annots; // annotations array
110 Object contents; // page contents
111 GBool ok; // true if page is valid