mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
Skip any whitespace after the first object in linearized PDFs (issue 17665)
This way the code is now consistent with the non-linearized branch in the `PDFDocument.startXRef` getter.
This commit is contained in:
parent
eb5e6e68d6
commit
37e98e39f6
4 changed files with 30 additions and 1 deletions
|
@ -930,7 +930,14 @@ class PDFDocument {
|
|||
// Find the end of the first object.
|
||||
stream.reset();
|
||||
if (find(stream, ENDOBJ_SIGNATURE)) {
|
||||
startXRef = stream.pos + 6 - stream.start;
|
||||
stream.skip(6);
|
||||
|
||||
let ch = stream.peekByte();
|
||||
while (isWhiteSpace(ch)) {
|
||||
stream.pos++;
|
||||
ch = stream.peekByte();
|
||||
}
|
||||
startXRef = stream.pos - stream.start;
|
||||
}
|
||||
} else {
|
||||
// Find `startxref` by checking backwards from the end of the file.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue