]> git.parisson.com Git - pdf.js.git/commitdiff
minor fix to render page, add F command, added inhertable dictionary entries
authorsbarman <sbarman@L3CWZ5T.(none)>
Tue, 21 Jun 2011 17:49:02 +0000 (10:49 -0700)
committersbarman <sbarman@L3CWZ5T.(none)>
Tue, 21 Jun 2011 17:49:02 +0000 (10:49 -0700)
pdf.js

diff --git a/pdf.js b/pdf.js
index fda5b512ec7103069fa01d398536014f85fd7381..21a131bfddf2bf9981edb5f6ae27a3924e3a7ac4 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -784,6 +784,16 @@ var Dict = (function() {
         get2: function(key1, key2) {
             return this.get(key1) || this.get(key2);
         },
+        getOrInherit: function(key, xref) {
+            var obj = this.map[key];
+            var dict = this;
+            while (!obj && dict) {
+                dict = xref.fetchIfRef(dict.get("Parent"));
+                if (dict)
+                    obj = dict.get(key);
+            }
+            return obj;
+        },
         has: function(key) {
             return key in this.map;
         },
@@ -1701,10 +1711,11 @@ var Page = (function() {
             return shadow(this, "content", this.pageDict.get("Contents"));
         },
         get resources() {
-            return shadow(this, "resources", this.pageDict.get("Resources"));
+            return shadow(this, "resources", 
+                    this.pageDict.getOrInherit("Resources", this.xref));
         },
         get mediaBox() {
-            var obj = this.pageDict.get("MediaBox");
+            var obj = this.pageDict.getOrInherit("MediaBox", this.xref);
             return shadow(this, "mediaBox", ((IsArray(obj) && obj.length == 4)
                                              ? obj
                                              : null));
@@ -2154,6 +2165,7 @@ var CanvasGraphics = (function() {
             S: "stroke",
             s: "closeStroke",
             f: "fill",
+            F: "fill",
             "f*": "eoFill",
             B: "fillStroke",
             "B*": "eoFillStroke",