From 2fcc93c7516640e05f09164e5795dda0a033bb2d Mon Sep 17 00:00:00 2001 From: Julian Viereck Date: Mon, 5 Sep 2011 19:47:16 -0700 Subject: [PATCH] Make xObjForm use raw format --- pdf.js | 7 ++++--- web/viewer.js | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pdf.js b/pdf.js index db4d23179..2a494bf41 100644 --- a/pdf.js +++ b/pdf.js @@ -4252,8 +4252,8 @@ var PartialEvaluator = (function() { if ('Form' == type.name) { // console.log("got xobj that is a Form"); - args[0].code = this.eval(xobj, xref, xobj.dict.get('Resources'), - fonts, images); + args[0].raw = this.evalRaw(xobj, xref, xobj.dict.get('Resources'), + fonts, images, uniquePrefix); } if (xobj instanceof JpegStream) { images.bind(xobj); // monitoring image load @@ -5369,7 +5369,8 @@ var CanvasGraphics = (function() { this.endPath(); } - this.execute(ref.code, this.xref, stream.dict.get('Resources')); + var code = this.pe.evalFromRaw(ref.raw) + this.execute(code, this.xref, stream.dict.get('Resources')); this.restore(); }, diff --git a/web/viewer.js b/web/viewer.js index 082dfaa87..a65eb2e77 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -152,7 +152,8 @@ var PDFView = { while (container.hasChildNodes()) container.removeChild(container.lastChild); - var pdf = new WorkerPDFDoc(data); + // var pdf = new WorkerPDFDoc(data); + var pdf = new PDFDoc(new Stream(data)); var pagesCount = pdf.numPages; document.getElementById('numPages').innerHTML = pagesCount;