pdf.js/src/core
Jonas Jenwald 0c31320c12 [api-minor] Improve thumbnail handling in documents that contain interactive forms
To improve performance of the sidebar we use the page-canvases to generate the thumbnails whenever possible, since that avoids unnecessary re-rendering when the sidebar is open. This works generally well, however there's an old problem in PDF documents that contain interactive forms (when those are enabled): Note how the thumbnails become partially (or fully) blank, since those Annotations are not included in the OperatorList.[1]

We obviously want to keep using the `PDFThumbnailView.setImage`-method for most documents, however we need a way to skip it only for those pages that contain interactive forms.
As it turns out it's unfortunately not all that simple to tell, after the fact, from looking only at the OperatorList that some Annotations were skipped. While it might have been possible to try and infer that in the viewer, it'd not have been pretty considering that at the time when rendering finishes the annotationLayer has not yet been built.
The overall simplest solution that I could come up with, was instead to include a *summary* of the interactive form-state when doing the final "flushing" of the OperatorList and expose that information in the API.

---
[1] Some examples from our test-suite: `annotation-tx2.pdf` where the thumbnail is completely blank, and `bug1737260.pdf` where the thumbnail is missing the "buttons" found on the page.
2022-07-30 16:53:32 +02:00
..
xfa Enable the unicorn/prefer-logical-operator-over-ternary ESLint plugin rule 2022-07-12 10:52:37 +02:00
.eslintrc Enable the ESLint no-var rule globally 2021-03-13 16:12:53 +01:00
annotation.js [api-minor] Improve thumbnail handling in documents that contain interactive forms 2022-07-30 16:53:32 +02:00
arithmetic_decoder.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
ascii_85_stream.js Fix the remaining ESLint operator-assignment errors 2021-07-04 15:23:56 +02:00
ascii_hex_stream.js Fix the remaining ESLint operator-assignment errors 2021-07-04 15:23:56 +02:00
base_stream.js [api-minor] Remove the forceClamped-functionality in the Streams (issue 14849) 2022-04-29 14:46:30 +02:00
bidi.js Tweak the Bidi-detection heuristics for very short RTL strings (issue 11656) 2021-11-03 20:31:57 +01:00
calibri_factors.js XFA - Fix font scale factors (bug 1720888) 2021-07-28 19:10:42 +02:00
catalog.js [JS] Embedded JS scripts can have some null chars 2022-07-15 16:05:25 +02:00
ccitt_stream.js Prefer instanceof Dict rather than calling isDict() with one argument 2022-02-21 12:44:56 +01:00
ccitt.js Prevent an infinite loop when parsing corrupt /CCITTFaxDecode data (issue 14305) 2021-12-07 13:57:25 +01:00
cff_font.js Include and use the 14 standard fonts files. 2021-06-07 11:10:11 -07:00
cff_parser.js Use more for...of loops in the code-base 2022-07-17 16:18:54 +02:00
charsets.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
chunked_stream.js [api-minor] Remove the forceClamped-functionality in the Streams (issue 14849) 2022-04-29 14:46:30 +02:00
cleanup_helper.js Add a (global) cache to the getCharUnicodeCategory function 2022-01-25 09:59:34 +01:00
cmap.js Remove the isString helper function 2022-02-26 16:33:41 +01:00
colorspace.js Prefer instanceof Name rather than calling isName() with one argument 2022-02-21 12:45:00 +01:00
core_utils.js [JS] Embedded JS scripts can have some null chars 2022-07-15 16:05:25 +02:00
crypto.js Fix wrong order of arguments when calling the CipherTransform ctor (bug 1782186) 2022-07-29 12:46:45 +02:00
dataset_reader.js Refactor some xfa*** getters in document.js 2022-04-03 20:38:12 +02:00
decode_stream.js [api-minor] Remove the forceClamped-functionality in the Streams (issue 14849) 2022-04-29 14:46:30 +02:00
decrypt_stream.js Move the DecodeStream and StreamsSequenceStream from src/core/stream.js and into its own file 2021-04-28 10:16:51 +02:00
default_appearance.js [editor] Add support for saving newly added Ink 2022-06-08 22:16:01 +02:00
document.js [api-minor] Improve thumbnail handling in documents that contain interactive forms 2022-07-30 16:53:32 +02:00
encodings.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
evaluator.js Ignore invalid /CIDToGIDMap-entries when parsing fonts (issue 15139) 2022-07-20 11:58:44 +02:00
file_spec.js Prefer instanceof Dict rather than calling isDict() with one argument 2022-02-21 12:44:56 +01:00
flate_stream.js Remove some, with Prettier 2.3.0, unnecessary // prettier-ignore comments 2021-05-19 11:36:03 +02:00
font_renderer.js Enable the unicorn/prefer-at ESLint plugin rule (PR 15008 follow-up) 2022-06-09 21:21:19 +02:00
fonts_utils.js Include and use the 14 standard fonts files. 2021-06-07 11:10:11 -07:00
fonts.js Merge pull request #15157 from calixteman/1778484 2022-07-13 14:45:12 +02:00
function.js Enable the unicorn/prefer-at ESLint plugin rule (PR 15008 follow-up) 2022-06-09 21:21:19 +02:00
glyf.js Font renderer - get int8 instead of uint8 in composite glyphes (bug 1749563) 2022-01-18 22:06:23 +01:00
glyphlist.js Enable the no-var linting rule in src/core/glyphlist.js 2021-02-27 12:46:57 +01:00
helvetica_factors.js XFA - Fix font scale factors (bug 1720888) 2021-07-28 19:10:42 +02:00
image_utils.js Add general iteration support in the RefSet and RefSetCache classes 2022-03-18 14:27:34 +01:00
image.js Support images with /Filter-entries that contain Arrays (issue 15220) 2022-07-25 08:41:37 +02:00
jbig2_stream.js Prefer instanceof Dict rather than calling isDict() with one argument 2022-02-21 12:44:56 +01:00
jbig2.js Reduce unnecessary usage of Array.prototype.concat() 2022-06-19 13:40:52 +02:00
jpeg_stream.js Prefer instanceof Dict rather than calling isDict() with one argument 2022-02-21 12:44:56 +01:00
jpg.js Enable the ESLint no-loss-of-precision rule 2021-11-14 10:48:50 +01:00
jpx_stream.js Stop special-casing the dict parameter in the Jbig2Stream/JpegStream/JpxStream constructors 2021-04-28 13:44:47 +02:00
jpx.js [JPEG 2000] Add support for resetContextProbabilities (bug 1731483) 2022-02-26 13:05:23 +01:00
liberationsans_widths.js XFA - Fix font scale factors (bug 1720888) 2021-07-28 19:10:42 +02:00
lzw_stream.js Move the DecodeStream and StreamsSequenceStream from src/core/stream.js and into its own file 2021-04-28 10:16:51 +02:00
metadata_parser.js Move the XML-parser to the src/core/-folder 2021-02-17 13:12:01 +01:00
metrics.js [api-minor] Annotations - Adjust the font size in text field in considering the total width (bug 1721335) 2022-01-30 15:53:31 +01:00
myriadpro_factors.js XFA - Fix font scale factors (bug 1720888) 2021-07-28 19:10:42 +02:00
name_number_tree.js Support destinations in NameTrees with encoded keys (issue 14847) 2022-04-27 11:19:55 +02:00
object_loader.js Remove the isStream helper function 2022-02-17 13:51:36 +01:00
opentype_file_builder.js Convert src/core/opentype_file_builder.js to use standard classes 2021-05-02 21:00:28 +02:00
operator_list.js [api-minor] Improve thumbnail handling in documents that contain interactive forms 2022-07-30 16:53:32 +02:00
parser.js Update npm packages 2022-03-20 10:59:13 +01:00
pattern.js Enable the unicorn/prefer-at ESLint plugin rule (PR 15008 follow-up) 2022-06-09 21:21:19 +02:00
pdf_manager.js Add support for the /Catalog Base-URI when resolving URLs (issue 14802) 2022-04-19 17:14:52 +02:00
predictor_stream.js Prefer instanceof Dict rather than calling isDict() with one argument 2022-02-21 12:44:56 +01:00
primitives.js Enable the unicorn/prefer-logical-operator-over-ternary ESLint plugin rule 2022-07-12 10:52:37 +02:00
ps_parser.js Remove the closure used with the PostScriptToken class 2021-07-24 13:05:46 +02:00
run_length_stream.js Move the DecodeStream and StreamsSequenceStream from src/core/stream.js and into its own file 2021-04-28 10:16:51 +02:00
segoeui_factors.js XFA - Fix font scale factors (bug 1720888) 2021-07-28 19:10:42 +02:00
standard_fonts.js Add basic support for non-embedded ArialUnicodeMS fonts (issue 15044) 2022-06-15 10:37:20 +02:00
stream.js [api-minor] Remove the forceClamped-functionality in the Streams (issue 14849) 2022-04-29 14:46:30 +02:00
struct_tree.js Correct typos 2022-04-09 09:43:18 +09:00
to_unicode_map.js Convert src/core/to_unicode_map.js to use standard classes 2021-05-02 21:00:29 +02:00
type1_font.js Use more for...of loops in the code-base 2022-07-17 16:18:54 +02:00
type1_parser.js Use more for...of loops in the code-base 2022-07-17 16:18:54 +02:00
unicode.js Add a (global) cache to the getCharUnicodeCategory function 2022-01-25 09:59:34 +01:00
worker_stream.js Replace a bunch of Array.prototype.forEach() cases with for...of loops instead 2021-04-24 13:00:19 +02:00
worker.js Use more for...of loops in the code-base 2022-07-17 16:18:54 +02:00
writer.js Enable the unicorn/prefer-at ESLint plugin rule (PR 15008 follow-up) 2022-06-09 21:21:19 +02:00
xfa_fonts.js Enable the unicorn/prefer-at ESLint plugin rule (PR 15008 follow-up) 2022-06-09 21:21:19 +02:00
xml_parser.js Enable the unicorn/prefer-at ESLint plugin rule (PR 15008 follow-up) 2022-06-09 21:21:19 +02:00
xref.js [edition] Add support for saving a newly added FreeText 2022-06-08 14:34:09 +02:00