summaryrefslogtreecommitdiff
path: root/noncore/unsupported/qpdf/xpdf/Page.cc
Unidiff
Diffstat (limited to 'noncore/unsupported/qpdf/xpdf/Page.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/qpdf/xpdf/Page.cc40
1 files changed, 27 insertions, 13 deletions
diff --git a/noncore/unsupported/qpdf/xpdf/Page.cc b/noncore/unsupported/qpdf/xpdf/Page.cc
index 17c4481..9cc08c4 100644
--- a/noncore/unsupported/qpdf/xpdf/Page.cc
+++ b/noncore/unsupported/qpdf/xpdf/Page.cc
@@ -1,11 +1,11 @@
1//======================================================================== 1//========================================================================
2// 2//
3// Page.cc 3// Page.cc
4// 4//
5// Copyright 1996 Derek B. Noonburg 5// Copyright 1996-2002 Glyph & Cog, LLC
6// 6//
7//======================================================================== 7//========================================================================
8 8
9#ifdef __GNUC__ 9#ifdef __GNUC__
10#pragma implementation 10#pragma implementation
11#endif 11#endif
@@ -17,13 +17,13 @@
17#include "Dict.h" 17#include "Dict.h"
18#include "XRef.h" 18#include "XRef.h"
19#include "Link.h" 19#include "Link.h"
20#include "OutputDev.h" 20#include "OutputDev.h"
21#ifndef PDF_PARSER_ONLY 21#ifndef PDF_PARSER_ONLY
22#include "Gfx.h" 22#include "Gfx.h"
23#include "FormWidget.h" 23#include "Annot.h"
24#endif 24#endif
25#include "Error.h" 25#include "Error.h"
26#include "Page.h" 26#include "Page.h"
27 27
28//------------------------------------------------------------------------ 28//------------------------------------------------------------------------
29// PageAttrs 29// PageAttrs
@@ -90,22 +90,36 @@ PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict) {
90 rotate += 360; 90 rotate += 360;
91 } 91 }
92 while (rotate >= 360) { 92 while (rotate >= 360) {
93 rotate -= 360; 93 rotate -= 360;
94 } 94 }
95 95
96 // misc attributes
97 dict->lookup("LastModified", &lastModified);
98 dict->lookup("BoxColorInfo", &boxColorInfo);
99 dict->lookup("Group", &group);
100 dict->lookup("Metadata", &metadata);
101 dict->lookup("PieceInfo", &pieceInfo);
102 dict->lookup("SeparationInfo", &separationInfo);
103
96 // resource dictionary 104 // resource dictionary
97 dict->lookup("Resources", &obj1); 105 dict->lookup("Resources", &obj1);
98 if (obj1.isDict()) { 106 if (obj1.isDict()) {
99 resources.free(); 107 resources.free();
100 obj1.copy(&resources); 108 obj1.copy(&resources);
101 } 109 }
102 obj1.free(); 110 obj1.free();
103} 111}
104 112
105PageAttrs::~PageAttrs() { 113PageAttrs::~PageAttrs() {
114 lastModified.free();
115 boxColorInfo.free();
116 group.free();
117 metadata.free();
118 pieceInfo.free();
119 separationInfo.free();
106 resources.free(); 120 resources.free();
107} 121}
108 122
109GBool PageAttrs::readBox(Dict *dict, char *key, PDFRectangle *box) { 123GBool PageAttrs::readBox(Dict *dict, char *key, PDFRectangle *box) {
110 PDFRectangle tmp; 124 PDFRectangle tmp;
111 Object obj1, obj2; 125 Object obj1, obj2;
@@ -206,13 +220,13 @@ void Page::display(OutputDev *out, fouble dpi, int rotate,
206#ifndef PDF_PARSER_ONLY 220#ifndef PDF_PARSER_ONLY
207 PDFRectangle *box, *cropBox; 221 PDFRectangle *box, *cropBox;
208 Gfx *gfx; 222 Gfx *gfx;
209 Object obj; 223 Object obj;
210 Link *link; 224 Link *link;
211 int i; 225 int i;
212 FormWidgets *formWidgets; 226 Annots *annotList;
213 227
214 box = getBox(); 228 box = getBox();
215 cropBox = getCropBox(); 229 cropBox = getCropBox();
216 230
217 if (printCommands) { 231 if (printCommands) {
218 printf("***** MediaBox = ll:%g,%g ur:%g,%g\n", 232 printf("***** MediaBox = ll:%g,%g ur:%g,%g\n",
@@ -244,24 +258,24 @@ void Page::display(OutputDev *out, fouble dpi, int rotate,
244 link = links->getLink(i); 258 link = links->getLink(i);
245 out->drawLink(link, catalog); 259 out->drawLink(link, catalog);
246 } 260 }
247 out->dump(); 261 out->dump();
248 } 262 }
249 263
250 // draw AcroForm widgets 264 // draw non-link annotations
251 //~ need to reset CTM ??? 265 //~ need to reset CTM ???
252 formWidgets = new FormWidgets(xref, annots.fetch(xref, &obj)); 266 annotList = new Annots(xref, annots.fetch(xref, &obj));
253 obj.free(); 267 obj.free();
254 if (printCommands && formWidgets->getNumWidgets() > 0) { 268 if (annotList->getNumAnnots() > 0) {
255 printf("***** AcroForm widgets\n"); 269 if (printCommands) {
256 } 270 printf("***** Annotations\n");
257 for (i = 0; i < formWidgets->getNumWidgets(); ++i) { 271 }
258 formWidgets->getWidget(i)->draw(gfx); 272 for (i = 0; i < annotList->getNumAnnots(); ++i) {
259 } 273 annotList->getAnnot(i)->draw(gfx);
260 if (formWidgets->getNumWidgets() > 0) { 274 }
261 out->dump(); 275 out->dump();
262 } 276 }
263 delete formWidgets; 277 delete annotList;
264 278
265 delete gfx; 279 delete gfx;
266#endif 280#endif
267} 281}