]> git.parisson.com Git - pdf.js.git/commitdiff
Fixes to parser for the test pdf in www.unicode.org/charts
authorsbarman <sbarman@L3CWZ5T.(none)>
Tue, 5 Jul 2011 16:10:14 +0000 (11:10 -0500)
committersbarman <sbarman@L3CWZ5T.(none)>
Tue, 5 Jul 2011 16:10:14 +0000 (11:10 -0500)
pdf.js

diff --git a/pdf.js b/pdf.js
index 5644bf0360ba0863546160b951f3c2760a07ec4f..c34bc76edf18695fbe6cb83bca15a94b2ed31e35 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -2236,6 +2236,9 @@ var Lexer = (function() {
             var stream = this.stream;
             var ch;
             while (true) {
+                if (!stream.getChar)
+                    log("bad stream");
+
                 if (!(ch = stream.getChar()))
                     return EOF;
                 if (comment) {
@@ -2842,7 +2845,7 @@ var Page = (function() {
 
     constructor.prototype = {
         getPageProp: function(key) {
-            return this.pageDict.get(key);
+            return this.xref.fetchIfRef(this.pageDict.get(key));
         },
         inheritPageProp: function(key) {
             var dict = this.pageDict;
@@ -3579,6 +3582,7 @@ var CanvasGraphics = (function() {
         },
 
         compile: function(stream, xref, resources, fonts) {
+            resources = xref.fetchIfRef(resources) || new Dict();
             var xobjs = xref.fetchIfRef(resources.get("XObject")) || new Dict();
 
             var parser = new Parser(new Lexer(stream), false);