mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-23 08:38:06 +02:00
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
3 changed files with 13 additions and 3 deletions
|
@ -1237,10 +1237,11 @@ var XRef = (function XRefClosure() {
|
|||
trailers.push(position);
|
||||
position += skipUntil(buffer, position, startxrefBytes);
|
||||
} else if ((m = objRegExp.exec(token))) {
|
||||
if (typeof this.entries[m[1]] === 'undefined') {
|
||||
this.entries[m[1]] = {
|
||||
const num = m[1] | 0, gen = m[2] | 0;
|
||||
if (typeof this.entries[num] === 'undefined') {
|
||||
this.entries[num] = {
|
||||
offset: position - stream.start,
|
||||
gen: m[2] | 0,
|
||||
gen,
|
||||
uncompressed: true,
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue