Ensure that XRef.indexObjects
can handle object numbers with zero-padding (issue 10491)
All objects in the PDF document follow this pattern: ``` 0000000001 0 obj << % Some content here... >> endobj 0000000002 0 obj << % More content here... endobj ```
This commit is contained in:
parent
9128335c4d
commit
41fbc71ef9
@ -1237,10 +1237,11 @@ var XRef = (function XRefClosure() {
|
|||||||
trailers.push(position);
|
trailers.push(position);
|
||||||
position += skipUntil(buffer, position, startxrefBytes);
|
position += skipUntil(buffer, position, startxrefBytes);
|
||||||
} else if ((m = objRegExp.exec(token))) {
|
} else if ((m = objRegExp.exec(token))) {
|
||||||
if (typeof this.entries[m[1]] === 'undefined') {
|
const num = m[1] | 0, gen = m[2] | 0;
|
||||||
this.entries[m[1]] = {
|
if (typeof this.entries[num] === 'undefined') {
|
||||||
|
this.entries[num] = {
|
||||||
offset: position - stream.start,
|
offset: position - stream.start,
|
||||||
gen: m[2] | 0,
|
gen,
|
||||||
uncompressed: true,
|
uncompressed: true,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
1
test/pdfs/issue10491.pdf.link
Normal file
1
test/pdfs/issue10491.pdf.link
Normal file
@ -0,0 +1 @@
|
|||||||
|
https://github.com/mozilla/pdf.js/files/2793574/14_09_02.pdf
|
@ -840,6 +840,14 @@
|
|||||||
"link": false,
|
"link": false,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{ "id": "issue10491",
|
||||||
|
"file": "pdfs/issue10491.pdf",
|
||||||
|
"md5": "0759ec46739b13bb0b66170a18d33d4f",
|
||||||
|
"rounds": 1,
|
||||||
|
"link": true,
|
||||||
|
"firstPage": 2,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{ "id": "issue6289",
|
{ "id": "issue6289",
|
||||||
"file": "pdfs/issue6289.pdf",
|
"file": "pdfs/issue6289.pdf",
|
||||||
"md5": "0869f3d147c734ec484ffd492104095d",
|
"md5": "0869f3d147c734ec484ffd492104095d",
|
||||||
|
Loading…
Reference in New Issue
Block a user