22046 Commits

Author SHA1 Message Date
calixteman
b7d71eb7f8 Don't throw when printing with pdfBug enabled
It fixes #20847.
2026-03-17 10:54:32 +01:00
Tim van der Meij
394727a28c
Merge pull request #20887 from calixteman/fix_intermittent_comment_sidebar
Wait a little between each key press in the test 'must check that the comment sidebar is resizable with the keyboard'
2026-03-16 21:12:25 +01:00
Tim van der Meij
0a2c030c8b
Merge pull request #20888 from calixteman/debugger_skip_ops
Add the possibility to skip some ops in the debug view
2026-03-16 20:36:48 +01:00
Tim van der Meij
481a0cbe62
Merge pull request #20889 from calixteman/debugger_search_btns
(Debugger) Replace checkboxes in the search bar by toggle buttons
2026-03-16 20:35:17 +01:00
Tim van der Meij
109f6a9b49
Merge pull request #20890 from calixteman/debugger_mv_checkerboard
(Debugger) Don't draw the checkerboard on the canvas but add it behind
2026-03-16 20:34:15 +01:00
Tim van der Meij
0e964c248a
Merge pull request #20894 from Snuffleupagus/compileFontPathInfo-slice
Simplify compilation of font paths (PR 20346 follow-up)
2026-03-16 20:32:05 +01:00
Tim van der Meij
87c1231669
Merge pull request #20896 from Snuffleupagus/CachedCanvases-Map
Re-factor the `CachedCanvases` class to use a `Map` internally
2026-03-16 20:30:36 +01:00
Jonas Jenwald
2cc53270f3 Re-factor the CachedCanvases class to use a Map internally 2026-03-16 18:59:46 +01:00
Jonas Jenwald
fa7ddbb9bc Simplify compilation of font paths (PR 20346 follow-up)
Given that `CompiledFont.prototype.getPathJs` already returns data in the desired TypedArray format, we should be able to directly copy the font-path data which helps shorten the code a little bit (rather than the "manual" handling in PR 20346).

To ensure that this keeps working as expected, a non-production `assert` is added to prevent any future surprises.
2026-03-16 14:51:36 +01:00
calixteman
fc286aac4e
(Debugger) Don't draw the checkerboard on the canvas but add it behind 2026-03-15 23:20:18 +01:00
calixteman
c7837580b9
(Debugger) Replace checkboxes in the search bar by toggle buttons 2026-03-15 22:46:13 +01:00
Jonas Jenwald
d38cddf2b6
Merge pull request #20869 from Snuffleupagus/FontFaceObject-rm-bbox-setter
Remove the unused `bbox` setter in the `FontFaceObject` class (PR 20427 follow-up)
2026-03-15 22:46:12 +01:00
calixteman
e85c30e08a
Add the possibility to skip some ops in the debug view
The user has to click in the space before an op to add a breakpoint
and click again in order to skip it.
2026-03-15 22:25:45 +01:00
calixteman
3ff52e415f
Merge pull request #20862 from calixteman/bug2023106
Check for having Ref before adding them in a RefSet (bug 2023106)
2026-03-15 22:15:58 +01:00
Calixte Denizet
0fca64f01e
Check for having Ref before adding them in a RefSet (bug 2023106) 2026-03-15 22:03:39 +01:00
Calixte Denizet
2ac42392f0 Wait a little between each key press in the test 'must check that the comment sidebar is resizable with the keyboard' 2026-03-15 21:55:38 +01:00
Jonas Jenwald
f1e1973e6f Remove the unused bbox setter in the FontFaceObject class (PR 20427 follow-up)
The commit message for the patch in PR 20427 is pretty non-descriptive, being only a single line, however there's a bit more context in https://github.com/mozilla/pdf.js/pull/20427#issue-3597370951 but unfortunately the details there don't really make sense.
Note that the PR only changed main-thread code, but all the links are to worker-thread code!?

The `FontFaceObject` class is only used on the main-thread, and when encountering a broken font we fallback to the built-in font renderer; see 820b70eb25/src/display/font_loader.js (L135-L143)
Hence the `FontFaceObject` class *only* needs a way to set the `disableFontFace` property, however nowhere on the main-thread do we ever update the `bbox` of a font.
2026-03-15 21:16:18 +01:00
Tim van der Meij
1192e5e921
Merge pull request #20884 from calixteman/fix_extract_text
Fix the issue in the ref test tracemonkey-extract_0_2_12
2026-03-15 20:41:00 +01:00
Tim van der Meij
c2acab55d9
Merge pull request #20765 from calixteman/update_eslint
Update eslint to version 10
2026-03-15 20:26:09 +01:00
Tim van der Meij
1b88960ead
Merge pull request #20883 from Snuffleupagus/PatternInfo-pointBoundingBox
Use the `Util.pointBoundingBox` helper in the `PatternInfo` class (PR 20340 follow-up)
2026-03-15 19:46:58 +01:00
Tim van der Meij
665a631bdc
Merge pull request #20879 from Snuffleupagus/increase-MAX_SCALE
Increase the maximum viewer scale to 2500 percent
2026-03-15 19:46:36 +01:00
Tim van der Meij
6ca9389d25
Merge pull request #20878 from timvandermeij/exit-code
Use a non-zero exit code if the tests failed
2026-03-15 19:44:18 +01:00
calixteman
d5ac981d62
Update eslint to version 10
Unfortunately, eslint-plugin-import depends on eslint 9. This plugin doesn't seem to be
actively maintained (lot of open issues and PRs).
Fortunately there's a fork of the plugin that doesn't support eslint 10 yet but is actively maintained.
So this PR changes the eslint version to 10 and replaces eslint-plugin-import with eslint-plugin-import-x.
2026-03-15 19:36:54 +01:00
Calixte Denizet
dde0beafc6
Fix the issue in the ref test tracemonkey-extract_0_2_12
When getting the extracted document, the url for the wasms wasn't passed
and consequently the icc-based color wasn't rendered as expected because of the wasm for qcms.
2026-03-15 19:26:24 +01:00
Tim van der Meij
f49877ae95
Merge pull request #20877 from timvandermeij/updates
Update dependencies to the most recent versions
2026-03-15 19:07:04 +01:00
Jonas Jenwald
d0ee35470b Use the Util.pointBoundingBox helper in the PatternInfo class (PR 20340 follow-up)
Rather than computing the `bounds` manually, as done in PR 20340, we can shorten/simplify the code by using an existing helper instead.
2026-03-15 18:26:15 +01:00
Jonas Jenwald
e05df11e98 Increase the maximum viewer scale to 2500 percent
After PR 19128 huge zoom levels should no longer be an issue, so let's increase the maximum viewer scale a bit.
2026-03-15 15:45:34 +01:00
Tim van der Meij
c798f88bdb
Use a non-zero exit code if the tests failed
The bots currently detect if the tests failed or not by checking the
output text, but this is error-prone as it would break if the text gets
changed (which is rather unexpected) and it's non-standard as usually
processes report success/failure via their exit code.

This commit makes sure that the test process fails with a non-zero exit
code if the tests failed, and a zero exit code otherwise. Note that we
keep the same output text as before, so this change should not impact
the bots, but it does form another step to unlock usage in GitHub
Actions (which uses the exit code of commands to determine the status of
the workflow run).
2026-03-15 15:13:56 +01:00
Tim van der Meij
534a199d18
Fix vulnerability in the flatted dependency
This patch is generated with `npm audit fix` and fixes CVE-2026-32141.
2026-03-15 14:54:11 +01:00
Tim van der Meij
b7ebd80db8
Update dependencies to the most recent versions 2026-03-15 14:53:11 +01:00
Tim van der Meij
3127492a38
Merge pull request #20875 from Snuffleupagus/version-5.6
Bump library version to `5.6`
2026-03-15 14:36:01 +01:00
calixteman
a3a205d69b
Merge pull request #20871 from calixteman/refactor_debugger
Split the new debugger into multiple files
2026-03-15 14:29:13 +01:00
Jonas Jenwald
f54c0b1619 Bump library version to 5.6 2026-03-15 14:03:10 +01:00
calixteman
7bac644731
Split the new debugger into multiple files
Instead of having all the code for the new debugger in a single file,
split it into multiple files.
This makes it easier to navigate and maintain the codebase.
It'll be make hacking and fixing bugs in the debugger easier.
2026-03-15 13:21:26 +01:00
Tim van der Meij
315491dd32
Merge pull request #20840 from Snuffleupagus/getDocument-rm-length
[api-minor] Remove the `length` parameter from `getDocument`
2026-03-15 11:48:02 +01:00
Tim van der Meij
b5c55002ef
Merge pull request #20870 from mozilla/dependabot/npm_and_yarn/undici-7.24.2
Bump undici from 7.21.0 to 7.24.2
2026-03-15 11:44:42 +01:00
calixteman
8f7a615455
Merge pull request #20860 from calixteman/radial_gradients
Fix the rendering of the radial gradient when a center is outside of the other circle and there's no extend
2026-03-14 16:07:39 +01:00
dependabot[bot]
85fe14ac94
Bump undici from 7.21.0 to 7.24.2
Bumps [undici](https://github.com/nodejs/undici) from 7.21.0 to 7.24.2.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v7.21.0...v7.24.2)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 7.24.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-14 10:34:32 +00:00
Jonas Jenwald
09a9a7bd0b [api-minor] Remove the length parameter from getDocument
This is an old API-parameter that is now unused within the PDF.js project itself, and its description says that it's (partly) being used for "range requests operations".
Note that the `length` API-parameter is used to set the *initial* `contentLength` in various `BasePDFStreamReader` implementations, however it's always overridden by the "Content-Length" header (sent by the server) when that one exists *and* is a valid number. While we currently fallback to the keep the initial `contentLength` otherwise, note however how in that case range requests will always be *disabled* and thus the only spot in the code-base [where `fullReader.contentLength` is necessary](873378b718/src/core/worker.js (L230-L236)) cannot actually be reached.

Hence the only possible reason to use the `length` API-parameter would be for improved progress reporting[1] during streaming of PDF data in rare cases where the "Content-Length" header is missing/invalid, but the user *somehow* has information from another source about the correct `length` of the PDF document.
That situation feels very much like an edge-case, but it's obviously impossible to know if someone is depending on it. However, please note that there's a work-around available for users affected by this removal:
 - Implement a `PDFDataRangeTransport` instance together with custom data-fetching[2], since in that case its `length`-parameter will always be used as-is.

Finally, updates various `BasePDFStreamReader` implementations to only set the `_isRangeSupported` field once the headers are available (since previously we'd just overwrite the "initial" value anyway).

---

[1] I.e. to avoid the "indeterminate" loadingBar being displayed in the viewer.

[2] This is what e.g. the Firefox PDF Viewer uses.
2026-03-13 23:42:45 +01:00
Tim van der Meij
820b70eb25
Merge pull request #20858 from calixteman/move_save_as_to_export_selected
Move 'Save as...' menu to 'Export selected...'
2026-03-13 22:04:12 +01:00
Tim van der Meij
94b7f8f998
Merge pull request #20863 from calixteman/fix_intermittent_undo_bar
Only focus the undo bar when the focus isn't inside
2026-03-13 22:03:45 +01:00
Tim van der Meij
23926ee948
Merge pull request #20861 from Snuffleupagus/split-obj-bin-transform
Split the `src/shared/obj-bin-transform.js` file into separate files for the main/worker threads (PR 20197 follow-up)
2026-03-13 21:07:50 +01:00
Tim van der Meij
f4c6fff759
Merge pull request #20865 from Snuffleupagus/internal-viewer-urls
Bundle the necessary files and set the correct `cMapUrl`, `iccUrl`, and `standardFontDataUrl` when building `gulp internal-viewer`
2026-03-13 21:02:30 +01:00
Jonas Jenwald
75739a173b Bundle the necessary files and set the correct cMapUrl, iccUrl, and standardFontDataUrl when building gulp internal-viewer
Without these changes none of the relevant functionality would work in the *built* internal-viewer.
2026-03-13 18:16:10 +01:00
calixteman
1d25607b9c
Move 'Save as...' menu to 'Export selected...' 2026-03-13 17:29:12 +01:00
calixteman
a7083d08ff
Merge pull request #20854 from calixteman/bug2022769
Add a button for unchecking all the checked thumbnails (bug 2022769)
2026-03-13 15:58:24 +01:00
Calixte Denizet
df4a5638d0
Add a button for unchecking all the checked thumbnails (bug 2022769) 2026-03-13 14:18:51 +01:00
calixteman
fbfccebb81
Merge pull request #20850 from calixteman/bug2021828
Don't let the user delete/cut all the pages (bug 2021828)
2026-03-13 14:06:01 +01:00
Calixte Denizet
bbf178c5ee Only focus the undo bar when the focus isn't inside
It should fix the test "must work properly when selecting undo by keyboard"
which calls focus() but it can be steal by fixed callback in setTimeout.
2026-03-13 13:53:51 +01:00
Jonas Jenwald
67f3972bf0 Add a private FontInfo helper method for reading array-data (PR 20197 follow-up)
Currently the `bbox`, `fontMatrix`, and `defaultVMetrics` getters duplicate almost the same code, which we can avoid by adding a new helper method (similar to existing ones for reading numbers and strings).

The added `assert` in the new helper method also caught a bug in how the `defaultVMetrics` length was compiled.
2026-03-13 11:21:37 +01:00