Commit Graph

17535 Commits

Author SHA1 Message Date
Jonas Jenwald
1a4bfd2fc3 Update npm packages
Note that while some packages increased the *major* version, it doesn't appear to cause any breakage as far as I can tell.
2023-07-15 10:44:30 +02:00
calixteman
ee373b313b
Merge pull request #16690 from calixteman/stamp_resize
[Editor] Resize the image when the page is zoomed
2023-07-14 12:16:44 +02:00
Calixte Denizet
5a692b2c33 [Editor] Resize the image when the page is zoomed
In order to reproduce the issue:
 - scale down the image
 - zoom the page and the image is pixellated
So this patch allow to redraw the image when zooming.
2023-07-13 20:36:23 +02:00
calixteman
36fc34ebe8
Merge pull request #16686 from calixteman/bug1843255
[Editor] Always use the data url when loading a SVG in order to avoid CSP issue (bug 1843255)
2023-07-13 15:12:49 +02:00
Calixte Denizet
ed42577d9c [Editor] Always use the data url when loading a SVG in order to avoid CSP issue (bug 1843255) 2023-07-13 14:10:28 +02:00
Jonas Jenwald
762d86a59e
Merge pull request #16683 from Snuffleupagus/app-isOffscreenCanvasSupported
Access the `isOffscreenCanvasSupported` option *once* in `PDFViewerApplication._initializeViewerComponents`
2023-07-12 21:44:34 +02:00
Jonas Jenwald
b449da31ca
Merge pull request #16678 from Snuffleupagus/writeStream-tweaks
Tweak the `writeStream` implementation slightly
2023-07-12 21:43:01 +02:00
Jonas Jenwald
040d5bb294
Merge pull request #16675 from Snuffleupagus/pr-16659-followup
Re-enable editing, if necessary, when exiting PresentationMode (PR 16659 follow-up)
2023-07-12 21:41:43 +02:00
calixteman
46cec96900
Merge pull request #16642 from calixteman/issue16633
[Editor] Try to make the position of an edited FreeText the more accurated as possible
2023-07-12 21:08:16 +02:00
Calixte Denizet
944c68ee85 [Editor] Try to make the position of an edited FreeText the more accurated as possible
- Take into account the page translation,
- Take into account the correct translation for the editor border,
- Take into account the position of the first glyph in the annotation,
- Take into account the rotation of the editor.

Close #16633.
2023-07-12 19:53:57 +02:00
Jonas Jenwald
7e04ca395f Access the isOffscreenCanvasSupported option *once* in PDFViewerApplication._initializeViewerComponents
There's no good reason for getting this option multiple times in the same method. Also, we can slightly re-factor how the `editorStampButton` is made visible.
2023-07-12 17:33:20 +02:00
Jonas Jenwald
5cfe792349 Tweak the writeStream implementation slightly
- Do the /Filter and /DecodeParms lookup in parallel, since that ought to be a *tiny* bit more efficient.
 - Avoid code-duplication when `CompressionStream` isn't supported, since we already have a fallback code-path at the end of the function.
2023-07-12 13:24:02 +02:00
Jonas Jenwald
7daa6b5fd8 Re-enable editing, if necessary, when exiting PresentationMode (PR 16659 follow-up)
This regressed in PR 16659, when the signature of the `PDFViewer.annotationEditorMode`-setter was changed, and it currently leads to an Error being thrown when exiting PresentationMode.
2023-07-11 22:34:20 +02:00
Jonas Jenwald
73d650af3e
Merge pull request #16669 from Snuffleupagus/esm-builder
[ESM] Convert the `external/builder/`-folder to use standard modules
2023-07-11 12:29:33 +02:00
Jonas Jenwald
5174232326 [ESM] Convert the external/builder/-folder to use standard modules 2023-07-11 11:38:59 +02:00
Jonas Jenwald
bcf14a49c0
Merge pull request #16668 from Snuffleupagus/esm-gulpfile
[ESM] Convert the `gulpfile` to use standard modules
2023-07-11 11:38:24 +02:00
calixteman
09d1be72f4
Merge pull request #16672 from calixteman/cheat_editorStamp_svg
[Editor] Cheat the stamp editor icon to make a linter in m-c happy
2023-07-11 09:59:32 +02:00
Calixte Denizet
414ea4a365 [Editor] Cheat the stamp editor icon to make a linter in m-c happy
At some point we won't use this icon anymore in the build-in pdf viewer
but we'll the one already in the m-c tree.
2023-07-10 21:18:05 +02:00
Jonas Jenwald
0bc9012b8f [ESM] Convert the gulpfile to use standard modules
This is a necessary intermediate step to allow converting files in the `external/builder/` folder.
2023-07-09 15:58:19 +02:00
Tim van der Meij
35202ec0f3
Merge pull request #16671 from Snuffleupagus/esm-parseDefaultPreferences
[ESM] Convert the "default preferences"-handling to use `import()` syntax
2023-07-09 15:38:30 +02:00
Tim van der Meij
1972b7311b
Merge pull request #16667 from Snuffleupagus/esm-cmaps
[ESM] Convert the "cmaps"-task to use `import()` syntax
2023-07-09 15:33:57 +02:00
Tim van der Meij
c0cc7f3eca
Merge pull request #16666 from Snuffleupagus/esm-wintersmith
[ESM] Convert the "wintersmith"-task to use `import()` syntax
2023-07-09 15:32:10 +02:00
Tim van der Meij
5a8ecbf560
Merge pull request #16665 from Snuffleupagus/esm-test
[ESM] Convert *most* of `test`-folder to use standard modules
2023-07-09 15:30:13 +02:00
Jonas Jenwald
6c601d3922 [ESM] Convert the "default preferences"-handling to use import() syntax
Unfortunately I wasn't able to come up with a *simple* way to just replace the synchronous `require`-call, since we need to ensure that the default preferences are available when bundling starts.
Hence this patch adds a new intermediate parsing-step in all the relevant gulp-tasks, but this shouldn't affect build-times noticeable since the amount of extra parsing is very small.

*Please note:* It's very possible that there's a better way to handle this, however I figured that unblocking further ESM-work is more important than a "perfect" solution.
2023-07-09 11:54:11 +02:00
Tim van der Meij
3efb276695
Merge pull request #16664 from Snuffleupagus/esm-terser
[ESM] Convert `parseMinified` to use `import()` syntax
2023-07-08 19:43:02 +02:00
Tim van der Meij
656c6d86fc
Merge pull request #16663 from Snuffleupagus/esm-importL10n
[ESM] Convert the `external/importL10n`-folder to use standard modules
2023-07-08 19:40:52 +02:00
Jonas Jenwald
f012fc5e70 [ESM] Convert the "cmaps"-task to use import() syntax 2023-07-08 18:52:58 +02:00
Tim van der Meij
42edc4d895
Merge pull request #16630 from Rob--W/crx-url-hash-init
Correct recognition of fragments at document load
2023-07-08 14:05:33 +02:00
Tim van der Meij
1567d022d9
Merge pull request #16631 from Rob--W/crx-remove-old-chrome-compat-code
[CRX] Drop code supporting ancient Chrome versions
2023-07-08 14:02:30 +02:00
Jonas Jenwald
ac3661972b [ESM] Convert the "wintersmith"-task to use import() syntax 2023-07-08 13:50:19 +02:00
Jonas Jenwald
a209ce811d [ESM] Convert *most* of test-folder to use standard modules 2023-07-08 13:13:04 +02:00
Jonas Jenwald
adfee2a723 [ESM] Convert parseMinified to use import() syntax 2023-07-08 10:01:16 +02:00
Jonas Jenwald
cec2a9a03f Update l10n files 2023-07-08 09:36:47 +02:00
Jonas Jenwald
a650fcd634 [ESM] Convert the external/importL10n-folder to use standard modules 2023-07-08 09:36:32 +02:00
Jonas Jenwald
5696c3aa3a
Merge pull request #16658 from Snuffleupagus/test-more-APIs
Add unit-tests to check that more PDF.js APIs expose the expected functionality
2023-07-08 08:16:57 +02:00
calixteman
52c98eb751
Merge pull request #16659 from calixteman/edit_freetexts
[Editor] Edit an existing FreeText annotation in double-clicking on it (bug 1787298)
2023-07-07 22:02:11 +02:00
Jonas Jenwald
c625230c71
Merge pull request #16661 from Snuffleupagus/issue-16660
Don't try to hide an already invisible PopupAnnotation (issue 16660)
2023-07-07 20:47:38 +02:00
Jonas Jenwald
559ea194f2 Don't try to hide an already invisible PopupAnnotation (issue 16660) 2023-07-07 19:13:48 +02:00
Calixte Denizet
5c5f9af803 [Editor] Edit an existing FreeText annotation in double-clicking on it (bug 1787298) 2023-07-07 17:44:45 +02:00
calixteman
c33e6ceb03
Merge pull request #16650 from calixteman/editor_allow_svg
[Editor] Support svg images in the stamp annotation
2023-07-07 16:30:12 +02:00
Calixte Denizet
4fcc2ef23f [Editor] Support svg images in the stamp annotation
createImageBitmap doesn't work with svg files (see bug 1841972), so we need to workaround
this in using an Image.
When printing/saving we must rasterize the image, hence we get the biggest bitmap as image
reference to avoid duplications or poor quality on rendering.
2023-07-07 15:59:13 +02:00
Jonas Jenwald
506bca5e6d Add unit-tests to check that more PDF.js APIs expose the expected functionality
Similar to e.g. PR 16587, let's ensure that the `pdf.worker.js` and `pdf.image_decoders.js` files expose the expected functionality.
2023-07-07 12:36:21 +02:00
calixteman
eb2527e9d7
Merge pull request #16652 from calixteman/rm_all_exceptions
[Editor] Avoid to throw when deleting some invisible editors
2023-07-06 19:11:44 +02:00
Jonas Jenwald
091266c6fe
Merge pull request #16648 from Snuffleupagus/AppearanceStreamEvaluator-setFillColorSpace
Improve `parseAppearanceStream` to handle more "complex" ColorSpaces
2023-07-06 18:30:17 +02:00
Jonas Jenwald
c5caa98e8d
Merge pull request #16649 from Snuffleupagus/stamp-l10n
[Editor] Add l10n-strings for the Stamp-editor (PR 16585 follow-up)
2023-07-06 18:04:08 +02:00
Jonas Jenwald
7a896d1c4b [Editor] Add l10n-strings for the Stamp-editor (PR 16585 follow-up)
This ought to have been included in PR 16585, since we obviously need default (en-US) l10n-strings for this feature.
2023-07-06 17:57:29 +02:00
Calixte Denizet
e4b4d222fa [Editor] Avoid to throw when deleting some invisible editors 2023-07-06 16:55:51 +02:00
Jonas Jenwald
6442a6cc4e Improve parseAppearanceStream to handle more "complex" ColorSpaces
The existing code is unable to *correctly* extract the color from the appearance-stream when the ColorSpace-data is "complex". To reproduce this:
 - Open `freetexts.pdf` in the viewer.
 - Note the purple color of the "Hello World from Preview" annotation.
 - Enable any of the Editors.
 - Note how the relevant annotation is now black.
2023-07-06 15:58:09 +02:00
calixteman
8281bb8858
Merge pull request #16585 from calixteman/editor_stamp_1
[Editor] Add a basic stamp editor  (bug 1790255)
2023-07-06 12:21:50 +02:00
Jonas Jenwald
716493f10a
Merge pull request #16646 from Snuffleupagus/default_appearance-CMYK-typos
Fix typos when handling CMYK colors in `src/core/default_appearance.js`
2023-07-06 12:05:06 +02:00