1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 14:48:08 +02:00
Commit graph

20699 commits

Author SHA1 Message Date
Jonas Jenwald
1fb6edc713 Introduce a fetchSync helper function for the IccColorSpace classes
This reduces code duplication a tiny bit, which shouldn't hurt.
2025-03-17 14:58:53 +01:00
Jonas Jenwald
e37236e9af
Merge pull request #19673 from Snuffleupagus/rm-ftl-comment
Remove documentation for unused l10n variable (PR 18492 follow-up)
2025-03-17 14:28:12 +01:00
Jonas Jenwald
d00482380a Introduce more async code in the src/core/document.js file 2025-03-17 13:20:51 +01:00
Jonas Jenwald
e5e0856f99 Remove documentation for unused l10n variable (PR 18492 follow-up)
Looking at PR 18492 it doesn't seem that the `$percent` variable, for the `pdfjs-editor-new-alt-text-ai-model-downloading-progress` l10n-string, was ever used.
2025-03-17 12:20:30 +01:00
Tim van der Meij
92d7b6d09f
Merge pull request #19671 from timvandermeij/integration-tests-signature-intermittent
Fix the "Signature Editor Basic operations must check copy and paste" integration test
2025-03-16 21:35:25 +01:00
Tim van der Meij
2a4f970e00
Fix the "Signature Editor Basic operations must check copy and paste" integration test
This integration test fails intermittently because of concurrent
clipboard access due to running the test in parallel in both browsers.
It can be reproduced by introducing `await waitForTimeout(1000)` between
the copy and paste operations.

This commit fixes the issue by running the test sequentially instead,
mirroring the change from commit 0e94f2bd.
2025-03-16 20:35:36 +01:00
Tim van der Meij
e738566900
Merge pull request #19669 from timvandermeij/icc-colorspace-404
Don't get ICC color space files if required API options are missing
2025-03-16 18:45:21 +01:00
Tim van der Meij
f44cba86d5
Don't get ICC color space files if required API options are missing
This commit improves validation of the API options for the ICC color
space logic. If `useWasm` is `true` but the corresponding `wasmUrl`
or `iccUrl` API options are not provided we can avoid requesting
files with `null` URLs which always results in a 404 response.
2025-03-16 16:29:42 +01:00
Jonas Jenwald
4c5ad92584
Merge pull request #19667 from Snuffleupagus/version-5.1
Bump library version to `5.1`
2025-03-16 13:51:35 +01:00
Jonas Jenwald
e3e2396230 Bump library version to 5.1 2025-03-16 13:47:18 +01:00
Tim van der Meij
d86045eacb
Merge pull request #19632 from Snuffleupagus/issue-15085
[api-minor] Attempt to support fetching the raw data of the PDF document from the `PDFDocumentLoadingTask`-instance (issue 15085)
2025-03-16 12:32:20 +01:00
Tim van der Meij
f8c2a949b7
Merge pull request #19665 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2025-03-16 11:31:08 +01:00
Jonas Jenwald
9e8d4e4d46 [api-minor] Attempt to support fetching the raw data of the PDF document from the PDFDocumentLoadingTask-instance (issue 15085)
The new API-functionality will allow a PDF document to be downloaded in the viewer e.g. while the PasswordPrompt is open, or in cases when document initialization failed.
Normally the raw data of the PDF document would be accessed via the `PDFDocumentProxy.prototype.getData` method, however in these cases the `PDFDocumentProxy`-instance isn't available.
2025-03-16 10:09:44 +01:00
Tim van der Meij
33af8b5c2c
Update translations to the most recent versions 2025-03-15 20:42:08 +01:00
Tim van der Meij
85818f404f
Upgrade babel-loader to version 10.0.0
This is a major version bump, but the changelog at
https://github.com/babel/babel-loader/releases/tag/v10.0.0
doesn't indicate any breaking changes that should impact us.
2025-03-15 20:42:08 +01:00
Tim van der Meij
cfe6cc6a7e
Upgrade @metalsmith/layouts to version 3.0.0
This is a major version bump, and the changelog at
https://github.com/metalsmith/layouts/releases/tag/v3.0.0
indicates a breaking change that impacts us, namely that we need to
explicitly define the pattern and transformer that we wish to use.
2025-03-15 20:42:08 +01:00
Tim van der Meij
ef7e0ddae4
Update dependencies to the most recent versions 2025-03-15 20:42:08 +01:00
Jonas Jenwald
d1d88cc09e
Merge pull request #19662 from Snuffleupagus/xfa-rm-regex
Replace a few simple regular expressions in the XFA-code with string parsing
2025-03-15 19:44:30 +01:00
Tim van der Meij
2d1833b566
Merge pull request #19663 from timvandermeij/bump
Bump the stable version in `pdfjs.config`
2025-03-15 19:19:22 +01:00
Tim van der Meij
a1bcd789b9
Bump the stable version in pdfjs.config 2025-03-15 19:15:34 +01:00
Tim van der Meij
23972e1946
Merge pull request #19661 from Snuffleupagus/thumbnails-inline-finishRenderTask
Inline the `PDFThumbnailView.prototype.#finishRenderTask`  helper method
2025-03-15 18:46:26 +01:00
Jonas Jenwald
8a24c1907a Replace a few simple regular expressions in the XFA-code with string parsing
- Add a couple of `limit` parameters in cases where those were "missing", for `String.prototype.split()` calls, to avoid unnecessary parsing.

 - Remove some "pointless" initial trimming of leading/trailing spaces, since that's already done at a later parsing step in many cases.
2025-03-15 17:25:26 +01:00
Jonas Jenwald
6548c9f1f6 Inline the PDFThumbnailView.prototype.#finishRenderTask helper method
Given that the `draw` method is already asynchronous we can easily inline this old helper method, which shortens the code and improves consistency in the code-base (note the `BasePDFPageView`-implementation).
2025-03-15 14:19:16 +01:00
Jonas Jenwald
7ee061bcf1 Add a helper function, in web/pdf_thumbnail_view.js, for "zeroing" a canvas
This removes a tiny bit of code duplication.
2025-03-15 13:24:52 +01:00
Jonas Jenwald
b7eef925ac Shorten the PDFThumbnailView.prototype.#getReducedImageDims method (PR 19635 follow-up)
This method is slightly more verbose than necessary, hence we can shorten the code a little bit.
2025-03-15 13:19:34 +01:00
Tim van der Meij
4b2683ecb6
Merge pull request #19656 from Snuffleupagus/shorten-MeshStreamReader
Slightly shorten a couple of `MeshStreamReader` methods
2025-03-14 19:50:36 +01:00
Jonas Jenwald
9967ab4aa8
Merge pull request #19657 from Snuffleupagus/GenericL10n-rm-regex
Replace the regular expression in `GenericL10n.#getPaths` with simple string parsing
2025-03-14 16:21:54 +01:00
Jonas Jenwald
9180e27f15 Replace the regular expression in GenericL10n.#getPaths with simple string parsing 2025-03-14 15:54:14 +01:00
Jonas Jenwald
ec30f0788b Slightly shorten a couple of MeshStreamReader methods
By using object destructuring in the `readCoordinate` and `readComponents` methods we can ever so slightly shorten this code.
2025-03-14 12:57:41 +01:00
calixteman
2294a510b0
Merge pull request #19653 from calixteman/rm_strings_html
Remove all the translatable strings from the html
2025-03-13 21:24:34 +01:00
Calixte Denizet
88c3ed9a80 Remove all the translatable strings from the html 2025-03-13 18:38:29 +01:00
calixteman
8791b24742
Merge pull request #19652 from calixteman/rm_useless_css_var
[Editor] Remove useless css variable
2025-03-13 16:48:50 +01:00
Calixte Denizet
7c706b6525 [Editor] Remove useless css variable 2025-03-13 16:40:30 +01:00
calixteman
dc61e36bf4
Merge pull request #19651 from calixteman/fix_ftl
[Editor] Fix variable name in the ftl file
2025-03-13 16:36:38 +01:00
Calixte Denizet
56f58bde9a [Editor] Fix variable name in the ftl file
and add a linting rule to avoid such an error in the future.
2025-03-13 16:26:16 +01:00
calixteman
d5c185b90a
Merge pull request #19649 from calixteman/bug1953298
[Editor] Fix the title of saved signature button (bug 1953298)
2025-03-13 13:50:43 +01:00
Calixte Denizet
da105f71f6 [Editor] Fix the title of saved signature button (bug 1953298) 2025-03-13 13:07:45 +01:00
Jonas Jenwald
78b310afb1
Merge pull request #19650 from Snuffleupagus/shorten-crypto
Shorten the `src/core/crypto.js` file a little bit
2025-03-13 12:46:53 +01:00
Jonas Jenwald
ef01ceda1b Change a couple of "password" ref-tests to "eq" tests
Currrently these are just "load" tests, and by also testing rendering we get slightly better test-coverage for the `src/core/crypto.js` file.
2025-03-13 11:58:13 +01:00
Jonas Jenwald
0e15f709c4 Remove unnecessary else if when checking the encryptionKey in the CipherTransformFactory constructor
This can be simplified a tiny bit since we already throw `PasswordException` when no password is provided.
2025-03-13 11:58:13 +01:00
Jonas Jenwald
cc63ffa6bb Reduce duplication when checking the userPassword, in CipherTransformFactory.prototype.#prepareKeyData
Currently we duplicate the exact same code in both the `if`- and `else`-branches, which seems unnecessary, and we can also replace the manual loop.
2025-03-13 11:58:02 +01:00
calixteman
38cb01c629
Merge pull request #19648 from calixteman/bug1953290
[Editor] Fix the role of the different editors in order to make them interactive elements (bug 1953290)
2025-03-13 09:20:26 +01:00
Calixte Denizet
7fce3eac93 [Editor] Fix the role of the different editors in order to make them interactive elements (bug 1953290)
Having some interactive elements forces the screen readers to switch to form mode
and consequently they delegate the keyboard stuff to the browser.
This patch sets an aria label on each editor in order to have a better description than just
'application'.
2025-03-12 22:19:31 +01:00
Jonas Jenwald
a8ad7d6485
Merge pull request #19645 from Snuffleupagus/OutputScale-pixelRatio
Add an `OutputScale` static method to get the `devicePixelRatio`
2025-03-12 21:22:16 +01:00
Jonas Jenwald
319d239f41 Add an OutputScale static method to get the devicePixelRatio
Currently we lookup the `devicePixelRatio`, with fallback handling, in a number of spots in the code-base.
Rather than duplicating code we can instead add a new static method in the `OutputScale` class, since that one is now exposed in the API.
2025-03-12 21:07:06 +01:00
Jonas Jenwald
e4795f639c
Merge pull request #19644 from Snuffleupagus/crypto-PDFBase
Introduce a common base class for the `PDF17` and `PDF20` crypto classes
2025-03-12 21:05:39 +01:00
Jonas Jenwald
643c44b631
Merge pull request #19643 from Snuffleupagus/l10n-update
Update l10n files
2025-03-12 21:02:24 +01:00
Jonas Jenwald
0cbb2b1d13
Merge pull request #19646 from Snuffleupagus/dont-cache-MIN_TOUCH_DISTANCE_TO_PINCH
Don't shadow the `TouchManager.prototype.MIN_TOUCH_DISTANCE_TO_PINCH` value
2025-03-12 21:02:02 +01:00
Jonas Jenwald
bec6287b0a
Merge pull request #19647 from Snuffleupagus/bug-1953099
Let `Lexer.prototype.getNumber` treat more cases of a single minus sign as zero (bug 1953099)
2025-03-12 19:34:07 +01:00
calixteman
7bc7416111
Merge pull request #19642 from calixteman/bug1953003
[Editor] Fix the style of the buttons in dialog (bug 1953003)
2025-03-12 19:24:53 +01:00