Browse Source

Merge pull request #5910 from jordan-thoms/fix-concatenated-files

Fix error reading concatenated pdfs
Tim van der Meij 10 years ago
parent
commit
d484ebd492
  1. 13
      src/core/obj.js
  2. 1
      test/pdfs/.gitignore
  3. BIN
      test/pdfs/issue5909.pdf
  4. 6
      test/test_manifest.json

13
src/core/obj.js

@ -1061,12 +1061,13 @@ var XRef = (function XRefClosure() { @@ -1061,12 +1061,13 @@ var XRef = (function XRefClosure() {
trailers.push(position);
position += skipUntil(buffer, position, startxrefBytes);
} else if ((m = /^(\d+)\s+(\d+)\s+obj\b/.exec(token))) {
this.entries[m[1]] = {
offset: position,
gen: m[2] | 0,
uncompressed: true
};
if (typeof this.entries[m[1]] === 'undefined') {
this.entries[m[1]] = {
offset: position,
gen: m[2] | 0,
uncompressed: true
};
}
var contentLength = skipUntil(buffer, position, endobjBytes) + 7;
var content = buffer.subarray(position, position + contentLength);

1
test/pdfs/.gitignore vendored

@ -127,3 +127,4 @@ @@ -127,3 +127,4 @@
!issue5481.pdf
!issue5567.pdf
!issue5701.pdf
!issue5909.pdf

BIN
test/pdfs/issue5909.pdf

Binary file not shown.

6
test/test_manifest.json

@ -2125,5 +2125,11 @@ @@ -2125,5 +2125,11 @@
"md5": "d5b37f8bf1b3aafa1b4fcf19ebdc7c74",
"rounds": 1,
"type": "eq"
},
{ "id": "issue5909",
"file": "pdfs/issue5909.pdf",
"md5": "51a724136c0c10008bd061a78ea4b8fc",
"rounds": 1,
"type": "load"
}
]

Loading…
Cancel
Save