Scan for startxref more than 1024 chars from end #828
This commit is contained in:
parent
c0291e9fa3
commit
b1ed459443
14
src/core.js
14
src/core.js
@ -382,11 +382,15 @@ var PDFDocModel = (function pdfDoc() {
|
|||||||
startXRef = stream.pos + 6;
|
startXRef = stream.pos + 6;
|
||||||
} else {
|
} else {
|
||||||
// Find startxref at the end of the file.
|
// Find startxref at the end of the file.
|
||||||
var start = stream.end - 1024;
|
var found = false, pos = stream.end;
|
||||||
if (start < 0)
|
while(!found && pos > 0) {
|
||||||
start = 0;
|
pos -= 1024;
|
||||||
stream.pos = start;
|
if (pos < 0)
|
||||||
if (find(stream, 'startxref', 1024, true)) {
|
pos = 0;
|
||||||
|
stream.pos = pos;
|
||||||
|
found = find(stream, 'startxref', 1024, true);
|
||||||
|
}
|
||||||
|
if (found) {
|
||||||
stream.skip(9);
|
stream.skip(9);
|
||||||
var ch;
|
var ch;
|
||||||
do {
|
do {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user