1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
--- xpdf-orig/xpdf/Page.cc 2007-02-27 23:05:52.000000000 +0100
+++ xpdf-3.02/xpdf/Page.cc 2010-04-06 21:22:17.000000000 +0200
@@ -5,6 +5,9 @@
// Copyright 1996-2007 Glyph & Cog, LLC
//
//========================================================================
+//
+// Copyright 2009 Hartmut Henkel <hartmut_henkel@gmx.de>
+// for added metadataNF and resourcesNF needed by luatex
#include <aconf.h>
@@ -126,6 +129,10 @@
dict->lookup("BoxColorInfo", &boxColorInfo);
dict->lookup("Group", &group);
dict->lookup("Metadata", &metadata);
+
+ // much better would be to get direct access to the page dictionary, but how?
+ dict->lookupNF("Metadata", &metadataNF);
+
dict->lookup("PieceInfo", &pieceInfo);
dict->lookup("SeparationInfo", &separationInfo);
@@ -136,6 +143,7 @@
obj1.copy(&resources);
}
obj1.free();
+ dict->lookupNF("Resources", &resourcesNF);
}
PageAttrs::~PageAttrs() {
@@ -143,9 +151,11 @@
boxColorInfo.free();
group.free();
metadata.free();
+ metadataNF.free();
pieceInfo.free();
separationInfo.free();
resources.free();
+ resourcesNF.free();
}
GBool PageAttrs::readBox(Dict *dict, char *key, PDFRectangle *box) {
--- xpdf-orig/xpdf/Page.h 2007-02-27 23:05:52.000000000 +0100
+++ xpdf-3.02/xpdf/Page.h 2010-04-06 21:21:51.000000000 +0200
@@ -5,6 +5,10 @@
// Copyright 1996-2003 Glyph & Cog, LLC
//
//========================================================================
+//
+// Copyright 2009 Hartmut Henkel <hartmut_henkel@gmx.de>
+// for added metadataNF, resourcesNF, getMetadataNF, and getResourcesNF
+// needed by luatex
#ifndef PAGE_H
#define PAGE_H
@@ -68,6 +72,10 @@
{ return group.isDict() ? group.getDict() : (Dict *)NULL; }
Stream *getMetadata()
{ return metadata.isStream() ? metadata.getStream() : (Stream *)NULL; }
+
+ // much better would be to get direct access to the page dictionary, but how?
+ Object * getMetadataNF() { return &metadataNF; }
+
Dict *getPieceInfo()
{ return pieceInfo.isDict() ? pieceInfo.getDict() : (Dict *)NULL; }
Dict *getSeparationInfo()
@@ -76,6 +84,9 @@
Dict *getResourceDict()
{ return resources.isDict() ? resources.getDict() : (Dict *)NULL; }
+ // much better would be to get direct access to the page dictionary, but how?
+ Object *getResourcesNF() { return &resourcesNF; }
+
private:
GBool readBox(Dict *dict, char *key, PDFRectangle *box);
@@ -91,9 +102,11 @@
Object boxColorInfo;
Object group;
Object metadata;
+ Object metadataNF;
Object pieceInfo;
Object separationInfo;
Object resources;
+ Object resourcesNF;
};
//------------------------------------------------------------------------
@@ -133,11 +146,13 @@
Dict *getBoxColorInfo() { return attrs->getBoxColorInfo(); }
Dict *getGroup() { return attrs->getGroup(); }
Stream *getMetadata() { return attrs->getMetadata(); }
+ Object *getMetadataNF() { return attrs->getMetadataNF(); }
Dict *getPieceInfo() { return attrs->getPieceInfo(); }
Dict *getSeparationInfo() { return attrs->getSeparationInfo(); }
// Get resource dictionary.
Dict *getResourceDict() { return attrs->getResourceDict(); }
+ Object *getResourcesNF() { return attrs->getResourcesNF(); }
// Get annotations array.
Object *getAnnots(Object *obj) { return annots.fetch(xref, obj); }
|