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

19718 commits

Author SHA1 Message Date
Tim van der Meij
3052e99f65
Merge pull request #18013 from Snuffleupagus/SimpleLinkService-extends-PDFLinkService
Re-factor `SimpleLinkService` to extend `PDFLinkService`
2024-04-29 18:41:53 +02:00
Jonas Jenwald
2b2ade7883
Merge pull request #18018 from Snuffleupagus/CompiledFont-tweak-caching
Reduce code-duplication when caching data in `CompiledFont.getPathJs`
2024-04-29 17:39:35 +02:00
Jonas Jenwald
627fe2d826
Merge pull request #18017 from Snuffleupagus/validate-widths
Add more validation of width-data
2024-04-29 14:17:23 +02:00
Aditi
04580168a2 Fix rendering problem when zooming on Safari 2024-04-29 17:32:06 +05:30
Jonas Jenwald
85ff8f34e2 Reduce code-duplication when caching data in CompiledFont.getPathJs 2024-04-29 13:18:31 +02:00
Jonas Jenwald
d411a072a4 Add more validation of width-data
The current `PartialEvaluator.extractWidths` implementation only contains *partial* validation of the width-data.
2024-04-29 10:51:16 +02:00
Jonas Jenwald
234067e745
Merge pull request #18014 from Snuffleupagus/validate-font-properties
Validate additional font-dictionary properties
2024-04-29 10:01:48 +02:00
Jonas Jenwald
08eb0566f7 Validate additional font-dictionary properties 2024-04-29 08:21:28 +02:00
calixteman
85e64b5c16
Merge pull request #18015 from calixteman/rm_eval_font_loader
Simplify the way to pass the glyph drawing instructions from the worker to the main thread
2024-04-28 23:27:47 +02:00
Jonas Jenwald
8c3d571939 Re-factor SimpleLinkService to extend PDFLinkService
Rather than having to maintain a dummy `IPDFLinkService` implementation, we can simply let it extend the primary `PDFLinkService` class instead.
Note how *some* methods already checked for an active PDF document, and those checks only needed to be used consistently throughout `PDFLinkService` in order for this to work.
2024-04-28 10:18:41 +02:00
Calixte Denizet
551e63901c Simplify the way to pass the glyph drawing instructions from the worker to the main thread
and remove the use of eval in the font loader.
2024-04-27 21:28:31 +02:00
Nicolò Ribaudo
e561a4af3c
Pin GitHub actions to Node.js 21
Node.js 22 was just released, and it seems like it's not compatible
with the `canvas` package. This commit pins the version on GitHub
actions to Node.js 21 as a temporary workaround.

This commit should be reverted once
https://github.com/Automattic/node-canvas/issues/2377
is fixed.
2024-04-26 19:23:16 +02:00
calixteman
90d4b9c2c0
Merge pull request #17868 from calixteman/interpolate_flag
Always enable smoothing when rendering downscaled image
2024-04-24 20:16:01 +02:00
Calixte Denizet
b511878ba7 Always enable smoothing when rendering downscaled image
and rely on the Interpolate flag only when the image is upscaled.
Fixes #16273.
2024-04-24 18:33:21 +02:00
calixteman
d1f494d68c
Merge pull request #17986 from calixteman/fix_struct_tree
Allow to insert several annotations under the same parent in the structure tree
2024-04-24 18:32:00 +02:00
Tim van der Meij
885dd72433
Merge pull request #17984 from Snuffleupagus/issue-17981
Validate explicit destinations on the worker-thread to prevent `DataCloneError` (issue 17981)
2024-04-24 16:25:02 +02:00
Calixte Denizet
45fa867577 Allow to insert several annotations under the same parent in the structure tree
While testing stamp insertion with the added pdf, I noticed that the tags using a MCID
weren't considered when trying to attach an annotation to it.
2024-04-24 16:23:05 +02:00
Tim van der Meij
7d1eabe2bd
Merge pull request #17969 from timvandermeij/integration-tests-timeout-annotations
Remove all `waitForTimeout` usage from the annotation integration tests
2024-04-24 16:14:54 +02:00
calixteman
dafc4f66c2
Merge pull request #17999 from calixteman/issue17998
Set correctly the change property for the event triggered when a choice list is changed
2024-04-24 16:07:28 +02:00
Tim van der Meij
10641d5af0
Remove all waitForTimeout usage from the annotation integration tests
This commit replaces all `waitForTimeout` occurrences with the
appropriate `waitForFunction` calls. Note that in some places they were
already present, so in those cases we could simply remove the
`waitForTimeout` call altogether.
2024-04-24 16:05:37 +02:00
Calixte Denizet
55808238e4 Set correctly the change property for the event triggered when a choice list is changed
It fixes #17998.
2024-04-24 14:48:22 +02:00
Tim van der Meij
bda98b91cb
Merge pull request #17967 from Snuffleupagus/eventBus-signal
Add `signal`-support in the `EventBus`, and utilize it in the viewer (PR 17964 follow-up)
2024-04-23 15:55:59 +02:00
Jonas Jenwald
7206d0a237 Validate explicit destinations on the worker-thread to prevent DataCloneError (issue 17981)
*Note:* This borrows a helper function from the viewer, however the code cannot be directly shared since the worker-thread has access to various primitives.
2024-04-22 22:51:35 +02:00
Tim van der Meij
522af265a7
Merge pull request #17977 from Snuffleupagus/parseImageProperties-TypedArray
Update `JpxImage.parseImageProperties` to support TypedArray data in IMAGE_DECODERS builds
2024-04-22 18:31:31 +02:00
Jonas Jenwald
9e80c6d228
Merge pull request #17978 from Snuffleupagus/pr-17428-followup
Extend the globally cached image main-thread copying to "complex" images as well (PR 17428 follow-up)
2024-04-22 16:46:23 +02:00
calixteman
f6b0413506
Merge pull request #17985 from calixteman/openjpeg_warn
Use the pdf.js warn when using jpx decoder
2024-04-22 16:06:13 +02:00
Calixte Denizet
55f943c4fa Use the pdf.js warn when using jpx decoder
Fixes #17980.
2024-04-22 16:02:45 +02:00
Tim van der Meij
335d8394cd
Merge pull request #17979 from Snuffleupagus/image-errors-shorter-msg
[api-minor] Remove the image-related error message prefixes
2024-04-22 15:35:10 +02:00
calixteman
c22e64cd05
Merge pull request #17983 from calixteman/openjpeg_simd
Improve jpx decoding by around 20% in enabling simd support when compiling OpenJPEG
2024-04-22 15:33:02 +02:00
Tim van der Meij
22c27f8520
Merge pull request #17972 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2024-04-22 15:32:10 +02:00
calixteman
9d891883b7
Merge pull request #17970 from calixteman/delete_from_xref
Correctly update the xref table when an annotation is deleted
2024-04-22 15:22:01 +02:00
calixteman
0867a1f9bc
Merge pull request #17973 from calixteman/no_contextmenu_resize
[Editor] Don't show the context menu when resizing
2024-04-22 15:13:26 +02:00
Calixte Denizet
c730a50540 Improve jpx decoding by around 20% in enabling simd support when compiling OpenJPEG 2024-04-22 13:08:47 +02:00
Jonas Jenwald
32b885c5ef Remove event listeners with signal in web/annotation_layer_builder.js and web/text_highlighter.js 2024-04-21 09:41:21 +02:00
Jonas Jenwald
912b57b95d [api-minor] Remove the image-related error message prefixes
Other custom errors, based on `BaseException`, do not use such a format.
2024-04-20 12:51:45 +02:00
Jonas Jenwald
2831caef13 Remove event listeners with signal in web/pdf_scripting_manager.js 2024-04-20 12:00:58 +02:00
Jonas Jenwald
bf785f2180 Remove event listeners with signal in web/pdf_history.js 2024-04-20 12:00:58 +02:00
Jonas Jenwald
702ee7b1e1 Add signal-support in the EventBus, and utilize it in the viewer (PR 17964 follow-up)
This mimics the `signal` option that's available for `addEventListener`, see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#signal).
2024-04-20 12:00:58 +02:00
Jonas Jenwald
91898e5923 Extend the globally cached image main-thread copying to "complex" images as well (PR 17428 follow-up)
In PR 17428 this functionality was limited to "larger" images, to not affect performance negatively. However it turns out that it's also beneficial to consider more "complex" images, regardless of their size, that contain /SMask or /Mask data; see issue 11518.
2024-04-20 11:10:09 +02:00
Jonas Jenwald
8970786d5b Update JpxImage.parseImageProperties to support TypedArray data in IMAGE_DECODERS builds
Given that the `decode` method only returns the actual image-data, a user would now need to invoke `parseImageProperties` to obtain e.g. the width and height.
This method only accepts `BaseStream`-instances, which are (obviously) not exposed, hence we extend it in IMAGE_DECODERS builds to wrap TypedArray data into the expected format.
2024-04-20 09:38:52 +02:00
Calixte Denizet
c57a0f38e9 [Editor] Don't show the context menu when resizing 2024-04-19 15:22:46 +02:00
Tim van der Meij
7affc7efa1
Update translations to the most recent versions 2024-04-19 14:57:04 +02:00
Tim van der Meij
0fdecb353d
Update dependencies to the most recent versions 2024-04-19 14:56:57 +02:00
Calixte Denizet
901d995a7e Correctly update the xref table when an annotation is deleted 2024-04-18 21:27:39 +02:00
Tim van der Meij
5ad42c13ad
Merge pull request #17964 from Snuffleupagus/addEventListener-signal
Remove *some* event listeners with `signal` in the viewer
2024-04-18 19:13:32 +02:00
Jonas Jenwald
ff2e0c8afd Skip the scroll/scrollend workaround in the Firefox PDF Viewer (PR 17724 follow-up)
Given that [bug 1881974](https://bugzilla.mozilla.org/show_bug.cgi?id=1881974) has been fixed in Firefox 126, the workaround should no longer be necessary in the *built-in* Firefox PDF Viewer.
2024-04-18 18:41:21 +02:00
Jonas Jenwald
46a29ff41b Remove event listeners with signal in web/app.js
By using the `signal` option when invoking `addEventListener`, see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#signal), we're able to remove an arbitrary number of event listeners with (effectively) a single line of code.
Besides getting rid of a bunch of `removeEventListener`-calls, which means shorter code, we no longer need to manually keep track of event-handling functions.
2024-04-18 18:41:21 +02:00
Jonas Jenwald
0788c4d918 Remove event listeners with signal in web/pdf_presentation_mode.js
By using the `signal` option when invoking `addEventListener`, see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#signal), we're able to remove an arbitrary number of event listeners with (effectively) a single line of code.
Besides getting rid of a bunch of `removeEventListener`-calls, which means shorter code, we no longer need to manually keep track of event-handling functions.
2024-04-18 18:41:18 +02:00
Tim van der Meij
aaa55d2b38
Merge pull request #17966 from timvandermeij/waitForTimeout
Remove `waitForTimeout` usage from the helper functions
2024-04-18 17:51:34 +02:00
Tim van der Meij
c2e9a6264c
Remove waitForTimeout usage from the dragAndDropAnnotation helper function
The timeout was introduced in commit 402e3fe with equal timeouts around
the helper function call. In commit 55e5af2 the timeouts around the
helper function call have been removed, and it looks like the helper
function itself was not updated purely due to an oversight.

The operations here should not require any timeouts because the promises
only resolve once the action is completed, which also explains why
removing the timeouts surrounding the helper function calls went without
any problems. It should therefore be safe to remove this timeout too.
2024-04-18 16:04:26 +02:00