pdf.js/src
Jonas Jenwald 23930a249e [api-minor] Let Catalog.getAllPageDicts return an *empty* dictionary when loading the first /Page fails (issue 15590)
In order to support opening certain corrupt PDF documents, particularly hand-edited ones, this patch adds support for letting the `Catalog.getAllPageDicts` method fallback to returning an *empty* dictionary to replace (only) the first /Page of the document.
Given that the viewer cannot initialize/load without access to the first page, this will thus allow e.g. document-level scripting to run as expected. Note that by effectively replacing a corrupt or missing first /Page in this way[1], we'll now render nothing but a *blank* page for certain cases of broken/corrupt PDF documents which may look weird.

*Please note:* This functionality is controlled via the existing `stopAtErrors` option, that can be passed to `getDocument`, since it's easy to imagine use-cases where this sort of fallback behaviour isn't desirable.

---
[1] Currently we still require that a /Pages-dictionary is found though, however it *may* be possible to relax even that assumption if that becomes absolutely necessary in future corrupt documents.
2022-11-03 12:51:48 +01:00
..
core [api-minor] Let Catalog.getAllPageDicts return an *empty* dictionary when loading the first /Page fails (issue 15590) 2022-11-03 12:51:48 +01:00
display Prevent mouse interaction with form elements in PresentationMode (issue 12232) 2022-10-30 21:55:44 +01:00
images Vectorize the logo. 2012-10-29 14:08:52 -04:00
scripting_api [JS] Some functions (print, alert,...) must be called only after a user activation 2022-10-28 18:52:07 +02:00
shared Merge pull request #15553 from Snuffleupagus/rm-CMapCompressionType-STREAM 2022-10-09 13:33:54 +02: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 [api-minor] Stop exposing the LoopbackPort class in the API 2022-09-23 13:44:35 +02: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