pdf.js/src
Jonas Jenwald 2fcf8bb5be Re-factor searching for incomplete objects in XRef.indexObjects (issue 15803)
When trying to find incomplete objects, i.e. those missing the "endobj"-string at the end, there's unfortunately a number of possible operators that we need to check for. Otherwise we could miss e.g. the "trailer" at the end of a corrupt PDF document, which is why the referenced document didn't work.

Currently we do all searching on the "raw" bytes of the PDF document, for efficiency, however this doesn't really work when we need to check for *multiple* potential command-strings. To keep the complexity manageable we'll instead use regular expressions here, but we can at least avoid creating lots of substrings thanks to the `RegExp.lastIndex` property; which is well supported across browsers according to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex#browser_compatibility

Note that this repeated regular expression usage could perhaps be slightly less efficient than the old code, however this method is only invoked for corrupt PDF documents.
2022-12-19 23:01:09 +01:00
..
core Re-factor searching for incomplete objects in XRef.indexObjects (issue 15803) 2022-12-19 23:01:09 +01:00
display [api-minor] Move, most of, the isPureXfa-handling from PDFViewer and into PDFPageView 2022-12-18 13:10:23 +01:00
images Vectorize the logo. 2012-10-29 14:08:52 -04:00
scripting_api [JS] Run the named actions before running the format when the file is open (issue #15818) 2022-12-13 21:12:32 +01:00
shared Stop duplicating the platform getter in multiple files 2022-11-29 12:14:40 +01:00
interfaces.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
license_header_libre.js Use correct case for JavaScript 2022-04-21 23:56:28 +08:00
license_header.js Update the year in the license_header files 2022-01-27 19:24:31 +01:00
pdf.image_decoders.js Fix the Jbig2Image export for the gulp image_decoders build (PR 9729 follow-up, issue 13367) 2021-05-12 19:41:29 +02:00
pdf.js Attempt to expose OnProgressParameters in the TypeScript definitions (issue 15828) 2022-12-14 21:36:31 +01:00
pdf.sandbox.external.js [JS] Some functions (print, alert,...) must be called only after a user activation 2022-10-28 18:52:07 +02:00
pdf.sandbox.js [JS] Use beforeinput event to trigger a keystroke event in the sandbox 2022-01-23 19:53:01 +01:00
pdf.scripting.js Tweak the pdf.scripting.js bundling, to improve overall consistency 2020-10-25 16:36:56 +01:00
pdf.worker.entry.js Update the year in the license_header files 2022-01-27 19:24:31 +01:00
pdf.worker.js Convert the src/pdf.js and src/pdf.worker.js files to use standard import/export statements 2020-05-20 13:18:23 +02:00
worker_loader.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00