Commit Graph

17446 Commits

Author SHA1 Message Date
Calixte Denizet
5ffaa64167 Fix integration tests 2023-06-20 17:52:20 +02:00
calixteman
fc487c8aa9
Merge pull request #16552 from calixteman/simplify_popup
[api-minor] Make the popup independent of their associated annotations
2023-06-20 16:10:45 +02:00
Calixte Denizet
d1e172458f [api-minor] Make the popup independent of their associated annotations
- it'll help to be able to move popups on screen to let the user read the text
- popups won't inherit some properties from their parent:
  - the popup can be misrendered if for example the parent has a clip-path property.
- add an outline to the popup when the parent is focused.
- hide a popup when it's clicked.
2023-06-20 15:30:39 +02:00
calixteman
d01efc6767
Merge pull request #16567 from calixteman/issue16566
[Editor] Show hidden annotations once editing is finished
2023-06-19 23:50:40 +02:00
Calixte Denizet
ae3cee95a6 [Editor] Show hidden annotations once editing is finished 2023-06-19 23:03:45 +02:00
calixteman
a5c10b6d89
Merge pull request #16563 from calixteman/bug1838855
Guess that a checkbox belongs to a group in using its T value (bug 1838855)
2023-06-16 20:40:34 +02:00
Calixte Denizet
5c0054d58d Guess that a checkbox belongs to a group in using its T value (bug 1838855) 2023-06-16 18:45:09 +02:00
calixteman
46b8f9e2f2
Merge pull request #16561 from calixteman/editor_copy_existing
[Editor] Avoid an exception when copying an existing editor
2023-06-16 14:47:55 +02:00
Calixte Denizet
ca3e45755c [Editor] Avoid an exception when copying an existing editor 2023-06-16 14:19:37 +02:00
Jonas Jenwald
04c31a55d2
Merge pull request #16558 from Snuffleupagus/writeStream-filter-fixes
Improve handling of /Filter-entries in `writeStream`
2023-06-16 13:07:41 +02:00
Jonas Jenwald
2cb113b545 Improve handling of /Filter-entries in writeStream
Fix handling of /Filter-entries, since the current implementation could potentially corrupt the data if there's multiple filters present.
Please note that filters are applied *sequentially* during decoding, starting from the first one in the Array, hence the first Array-entry needs to be /FlateDecode in order for things to actually work correctly.

To prevent a future bug, if we want to save more "complex" data such as images, also ensure that we include any existing /DecodeParms-entries when updating the /Filter-entry.
2023-06-16 10:27:23 +02:00
Jonas Jenwald
bd46a934ec
Merge pull request #16559 from calixteman/test_compression
Add a test to check that the compression is ok when saving an annotation
2023-06-16 10:27:10 +02:00
Calixte Denizet
85b38fc247 Add a test to check that the compression is ok when saving an annotation 2023-06-16 10:05:42 +02:00
calixteman
8937cac621
Merge pull request #16556 from calixteman/no_dup_when_saving
[Editor] Avoid to have duplicated entries in the Annot array when saving an existing and modified annotation
2023-06-15 23:47:25 +02:00
calixteman
5f1fba503c
Merge pull request #16557 from calixteman/no_events_on_canvas
Disable events on canvas in the annotation layer
2023-06-15 22:18:12 +02:00
Calixte Denizet
71479fdd21 [Editor] Avoid to have duplicated entries in the Annot array when saving an existing and modified annotation 2023-06-15 22:02:10 +02:00
Calixte Denizet
dd21139405 Disable events on canvas in the annotation layer 2023-06-15 21:10:40 +02:00
calixteman
64520a0c63
Merge pull request #16555 from calixteman/empty_freetext
[Editor] Don't add an editor for empty FreeText annotations
2023-06-15 19:44:13 +02:00
Calixte Denizet
1ab34d2ae4 [Editor] Don't add an editor for empty FreeText annotations 2023-06-15 18:33:03 +02:00
calixteman
5581e22cc7
Merge pull request #16535 from calixteman/restore_freetext
[Editor] Allow to edit FreeText annotations
2023-06-15 18:10:41 +02:00
calixteman
9f60686c59
Merge pull request #16554 from calixteman/issue16553
Add a container for Signature with their own canvas
2023-06-15 16:20:54 +02:00
Calixte Denizet
be25ee12bb Add a container for Signature with their own canvas 2023-06-15 16:11:52 +02:00
Calixte Denizet
0116a8f484 [Editor] Allow to edit FreeText annotations 2023-06-15 16:06:29 +02:00
Jonas Jenwald
a37f7d2477
Merge pull request #16543 from Snuffleupagus/limit-more-to-GENERIC
Limit more code to GENERIC builds
2023-06-15 13:58:52 +02:00
Jonas Jenwald
877884029d
Merge pull request #16551 from Snuffleupagus/page-destroyed-complete
Ensure that `cleanup` during rendering is actually ignored, to prevent a blank canvas
2023-06-15 12:26:57 +02:00
Jonas Jenwald
0650be4641
Merge pull request #16550 from Snuffleupagus/rm-RenderingCancelledException-type
[api-minor] Remove the `type` from `RenderingCancelledException` (PR 16226 follow-up)
2023-06-15 12:26:27 +02:00
Jonas Jenwald
033228a2fc
Merge pull request #16544 from Snuffleupagus/eslint-prefer-optional-catch-binding
Enable the `unicorn/prefer-optional-catch-binding` ESLint plugin rule
2023-06-15 12:25:42 +02:00
Jonas Jenwald
a591c3de84 Ensure that cleanup during rendering is actually ignored, to prevent a blank canvas
The existing unit-test doesn't work as intended, since the page never actually renders. Note how `cleanup` is *not* allowed to run when parsing and/or rendering is ongoing, however an (old) incorrect condition could prevent rendering from ever starting.

This is very old code, which has been slightly re-factored a couple of times (many years ago), however this doesn't appear to affect e.g. the default viewer since the incorrect behaviour seem highly dependent on "unlucky" timing.
Note also how at the start of the `PDFPageProxy.prototype.render`-method we purposely cancel any pending `cleanup`-call, to prevent unnecessary re-parsing for multiple sequential `render`-calls.

Finally, avoid running `cleanup` when document/page destruction has already started since it's pointless in that case.
2023-06-15 11:39:26 +02:00
Jonas Jenwald
89f29192a5 Actually limit SVGGraphics to GENERIC builds (PR 16226 follow-up)
After PR 16226 the deprecated SVG back-end is now unused in development mode, with the exception of unit-tests, hence we can re-factor how it's exposed in the API to avoid including a useless webpack-closure in e.g. the *built-in* Firefox PDF Viewer.
2023-06-14 21:38:10 +02:00
Jonas Jenwald
a8d4aad8b9 Limit PDFPageProxy.getOperatorList to development mode and GENERIC builds
Given that this API method isn't used anywhere within the PDF.js library itself, except for the unit-tests, we can avoid including what's effectively dead code in e.g. the *built-in* Firefox PDF Viewer.
2023-06-14 21:33:22 +02:00
Jonas Jenwald
225734dd00 [api-minor] Remove the type from RenderingCancelledException (PR 16226 follow-up)
After PR 16226 we're only using `RenderingCancelledException` together with canvas-rendering, hence the `type`-property is no longer necessary.
2023-06-14 15:40:25 +02:00
Jonas Jenwald
fee850737b Enable the unicorn/prefer-optional-catch-binding ESLint plugin rule
According to MDN this format is available in all browsers/environments that we currently support, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch#browser_compatibility

Please also see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-optional-catch-binding.md
2023-06-12 11:46:11 +02:00
Tim van der Meij
9af50dc358
Merge pull request #16541 from Snuffleupagus/inline-image-mask-checks
Improve SMask/Mask lookup when parsing inline images
2023-06-11 13:01:45 +02:00
Tim van der Meij
1e2f82050f
Merge pull request #16542 from Snuffleupagus/update-packages
Update packages and translations
2023-06-11 12:59:07 +02:00
Jonas Jenwald
68b05fb9cd Update l10n files 2023-06-11 11:32:48 +02:00
Jonas Jenwald
8415ff51b4 Update npm packages 2023-06-11 11:30:39 +02:00
Jonas Jenwald
1f42aaf21b Improve SMask/Mask lookup when parsing inline images
- Don't attempt to lookup an "SM" entry, since we're only using "SMask" in the `PDFImage` code and I also cannot find any mention in the PDF specification about that being a valid abbreviation for a Soft Mask entry. (There's only a `SM = Smoothness Tolerance` Graphics State parameter, which is obviously something completely different.)

 - Don't lookup the /SMask and /Mask entries unless it's actually an inline image, since it's pointless otherwise.

 - Last, but most importantly, only check for the *existence* of /SMask and /Mask entries but don't actually fetch the data. Note that if either one exists it'll contain a Stream, and those cannot be cached on the `XRef`-instance, which leads to unnecessary parsing/allocations and in this case we're not using the actual data for anything.
2023-06-10 13:19:43 +02:00
calixteman
b8447eb49f
Merge pull request #16523 from calixteman/restore_save
[Editor] Add the possibility to update an existing annotation with some new properties when saving or printing
2023-06-09 19:26:42 +02:00
Calixte Denizet
1a047f843c [Editor] Add the possibility to update an existing annotation with some new properties when saving or printing 2023-06-09 17:14:53 +02:00
calixteman
f8a84a6f03
Merge pull request #16539 from calixteman/issue16538
Concat data when push fails in the CFF compiler
2023-06-09 17:09:49 +02:00
Calixte Denizet
3d0ce1cff2 Concat data when push fails in the CFF compiler 2023-06-09 15:48:01 +02:00
calixteman
f2a29e858f
Merge pull request #16533 from calixteman/fix_freetext_undo
[Editor] Fix test failures in m-c because of the new FreeText undo/redo stuff
2023-06-08 14:30:39 +02:00
Calixte Denizet
baebf7b26d [Editor] Fix test failures in m-c because of the new FreeText undo/redo stuff 2023-06-08 13:38:52 +02:00
calixteman
22d350cae6
Merge pull request #16528 from calixteman/bug1831574
[Editor] Commit the text when the user hits ctrl+s (bug 1831574)
2023-06-06 12:13:14 +02:00
Calixte Denizet
3d98fb3c0b [Editor] Commit the text when the user hits ctrl+s (bug 1831574) 2023-06-06 11:40:54 +02:00
calixteman
a2b9e23f83
Merge pull request #16525 from calixteman/editor_undo_text_change
[Editor] Allow to undo/redo committed text modifications for FreeText
2023-06-06 10:53:35 +02:00
Calixte Denizet
2f0bb9dc2f [Editor] Allow to undo/redo committed text modifications for FreeText 2023-06-05 21:31:19 +02:00
calixteman
9cd84aa0b2
Merge pull request #16522 from calixteman/restore_get_freetext_info_from_as
[Editor] Guess font size and color from the AS of FreeText annotations
2023-06-05 18:08:58 +02:00
Calixte Denizet
ba8c996623 [Editor] Guess font size and color from the AS of FreeText annotations 2023-06-05 17:15:17 +02:00
calixteman
77fb6834d6
Merge pull request #16521 from calixteman/restore_connect_layers
[Editor] Connect then annotation layer and the editor one
2023-06-05 14:20:24 +02:00