30 double x1, y1, x2, y2;
32 PDFRectangle() { x1 = y1 = x2 = y2 = 0; }
33 PDFRectangle(
double x1A,
double y1A,
double x2A,
double y2A)
34 { x1 = x1A; y1 = y1A; x2 = x2A; y2 = y2A; }
35 GBool isValid() {
return x1 != 0 || y1 != 0 || x2 != 0 || y2 != 0; }
48 PageAttrs(PageAttrs *attrs, Dict *dict);
54 PDFRectangle *getBox() {
return limitToCropBox ? &cropBox : &mediaBox; }
55 PDFRectangle *getMediaBox() {
return &mediaBox; }
56 PDFRectangle *getCropBox() {
return &cropBox; }
57 GBool isCropped() {
return haveCropBox; }
58 PDFRectangle *getBleedBox() {
return &bleedBox; }
59 PDFRectangle *getTrimBox() {
return &trimBox; }
60 PDFRectangle *getArtBox() {
return &artBox; }
61 int getRotate() {
return rotate; }
62 GString *getLastModified()
63 {
return lastModified.isString()
64 ? lastModified.getString() : (GString *)NULL; }
65 Dict *getBoxColorInfo()
66 {
return boxColorInfo.isDict() ? boxColorInfo.getDict() : (Dict *)NULL; }
68 {
return group.isDict() ? group.getDict() : (Dict *)NULL; }
70 {
return metadata.isStream() ? metadata.getStream() : (Stream *)NULL; }
72 {
return pieceInfo.isDict() ? pieceInfo.getDict() : (Dict *)NULL; }
73 Dict *getSeparationInfo()
74 {
return separationInfo.isDict()
75 ? separationInfo.getDict() : (Dict *)NULL; }
76 Dict *getResourceDict()
77 {
return resources.isDict() ? resources.getDict() : (Dict *)NULL; }
81 GBool readBox(Dict *dict,
const char *key, PDFRectangle *box);
83 PDFRectangle mediaBox;
87 PDFRectangle bleedBox;
96 Object separationInfo;
108 Page(XRef *xrefA,
int numA, Dict *pageDict, PageAttrs *attrsA);
114 GBool isOk() {
return ok; }
117 PDFRectangle *getBox() {
return attrs->getBox(); }
118 PDFRectangle *getMediaBox() {
return attrs->getMediaBox(); }
119 PDFRectangle *getCropBox() {
return attrs->getCropBox(); }
120 GBool isCropped() {
return attrs->isCropped(); }
121 double getWidth() {
return attrs->getBox()->x2 - attrs->getBox()->x1; }
122 double getHeight() {
return attrs->getBox()->y2 - attrs->getBox()->y1; }
123 PDFRectangle *getBleedBox() {
return attrs->getBleedBox(); }
124 PDFRectangle *getTrimBox() {
return attrs->getTrimBox(); }
125 PDFRectangle *getArtBox() {
return attrs->getArtBox(); }
126 int getRotate() {
return attrs->getRotate(); }
127 GString *getLastModified() {
return attrs->getLastModified(); }
128 Dict *getBoxColorInfo() {
return attrs->getBoxColorInfo(); }
129 Dict *getGroup() {
return attrs->getGroup(); }
130 Stream *getMetadata() {
return attrs->getMetadata(); }
131 Dict *getPieceInfo() {
return attrs->getPieceInfo(); }
132 Dict *getSeparationInfo() {
return attrs->getSeparationInfo(); }
135 Dict *getResourceDict() {
return attrs->getResourceDict(); }
138 Object *getAnnots(Object *obj) {
return annots.fetch(xref, obj); }
141 Object *getContents(Object *obj) {
return contents.fetch(xref, obj); }
144 void display(OutputDev *out,
double dpi,
int rotate,
145 Links *links, Catalog *catalog,
146 GBool (*abortCheckCbk)(
void *data) = NULL,
147 void *abortCheckCbkData = NULL);
150 void displaySlice(OutputDev *out,
double dpi,
int rotate,
151 int sliceX,
int sliceY,
int sliceW,
int sliceH,
152 Links *links, Catalog *catalog,
153 GBool (*abortCheckCbk)(
void *data) = NULL,
154 void *abortCheckCbkData = NULL);