Merge pull request #374 from notmasteryet/tree-5

Fix shavian.pdf regression and related optimization
This commit is contained in:
Andreas Gal 2011-08-24 17:34:18 -07:00
commit aa6e5ca8dd

9
pdf.js
View File

@ -208,6 +208,11 @@ var DecodeStream = (function() {
this.readBlock();
var end = this.bufferLength;
// checking if bufferLength is still 0 then
// the buffer has to be initialized
if (!end)
this.buffer = new Uint8Array(0);
}
this.pos = end;
@ -3340,11 +3345,11 @@ var Page = (function() {
var xref = this.xref;
var content = xref.fetchIfRef(this.content);
var resources = xref.fetchIfRef(this.resources);
if (IsArray(this.content)) {
if (IsArray(content)) {
// fetching items
var i, n = content.length;
for (i = 0; i < n; ++i)
content[i] = xref.fetchIfRef(this.content[i]);
content[i] = xref.fetchIfRef(content[i]);
content = new StreamsSequenceStream(content);
}
this.code = gfx.compile(content, xref, resources, fonts, images);