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

19217 commits

Author SHA1 Message Date
Tim van der Meij
831a526c10
Merge pull request #18248 from timvandermeij/metalsmith
Replace Wintersmith with Metalsmith
2024-06-15 12:19:35 +02:00
Tim van der Meij
ce7cdf4670
Replace Wintersmith with Metalsmith
Wintersmith is no longer maintained given that the most recent version
is from six years ago, and all vulnerabilities that NPM reports
originate from Wintersmith's dependencies. Metalsmith, and its plugins,
on the other hand have recently had releases and don't have known
vulnerabilities. In fact, the number of reported vulnerabilities by NPM
even goes down to zero with this patch applied.

This commit therefore replaces Wintersmith with Metalsmith by providing
a transparent drop-in replacement, in a way that requires the least
amount of changes to the code and the generated output.

Note that this patch does update our versions of jQuery, Bootstrap and
the Highlight.js theme because the previous versions were very outdated
and didn't work correctly with Metalsmith. Moreover, those old versions
contained vulnerabilities that are hereby fixed.

Fixes #18198.
2024-06-14 20:37:13 +02:00
Tim van der Meij
7279ce6bad
Merge pull request #18247 from timvandermeij/readme
Don't recommend installing `gulp-cli` globally in the README and on the website
2024-06-14 20:26:12 +02:00
Tim van der Meij
0348559ef8
Don't recommend installing gulp-cli globally in the README and on the website
It's recommended to always install dependencies locally in the project
folder because global dependencies can easily conflict with other
projects and, because they are not managed by the project, diverge from
versions defined in e.g. `package.json`. Previously we installed
`gulp-cli` globally because at the time we lacked a convenient mechanism
to use Gulp otherwise, but nowadays NPM provides the `npx` command for
that purpose and recommends using it over global installations (see
https://docs.npmjs.com/downloading-and-installing-packages-globally
and PR #17489 that provided the ground work for using it).

This commit therefore updates our README and website to no longer recommend
installing `gulp-cli` globally but instead installing it locally from the
already existing entries in `package.json` like all other dependencies
we use. Not only does this remove the special-casing for `gulp-cli`
which simplifies the installation procedure, it also ensures that the
version ranges provided in `package.json` are respected.

This change is similar to the change in commit 92de2b7.

Fixes #18232.
Fixes 98ef8a1.
2024-06-14 18:41:44 +02:00
Tim van der Meij
aa68b8b4b3
Merge pull request #18234 from calixteman/improve_date_parsing
Improve date parsing in the js sandbox
2024-06-14 18:25:36 +02:00
Tim van der Meij
f9693b4d16
Merge pull request #18244 from Snuffleupagus/CSS-copyAll
Improve how the wait-cursor is toggled when copying all text
2024-06-14 18:23:03 +02:00
Tim van der Meij
f00152bf92
Merge pull request #18246 from calixteman/fix_js_error
Fix an query with an empty selector in integration tests
2024-06-14 18:20:44 +02:00
Calixte Denizet
c14c3cfc9f Improve date parsing in the js sandbox
If for example dd:mm is failing we just try with d:m which is equivalent
to the regex /d{1,2}:m{1,2}/. This way it allows the user to forget the
0 for the first days/months.
2024-06-14 17:21:50 +02:00
Calixte Denizet
6d1f7e806e Fix an query with an empty selector in integration tests
In looking the logs from Chrome bidi tests I noticed a js syntax error
which is fixed thanks to this patch.
2024-06-14 16:43:41 +02:00
calixteman
e3caa3c6ee
Merge pull request #18243 from calixteman/disable_ui_when_saving
Display a wait cursor when saving
2024-06-14 10:48:18 +02:00
Jonas Jenwald
97686c410c Improve how the wait-cursor is toggled when copying all text
- Use a CSS rule to display the wait-cursor during copying. Since copying may take a little while in long documents, there's a theoretical risk that something else could change the cursor in the meantime and just resetting to the saved-cursor could thus be incorrect.

 - Remove the `interruptCopyCondition` listener with an AbortController, since that's slightly shorter code.
2024-06-14 10:06:27 +02:00
Calixte Denizet
5ae936eb87 Display a wait cursor when saving
When the document is a bit long to save (for example in modifying a large document)
we must have something indicating that pdf.js is doing something.
2024-06-13 22:54:52 +02:00
Tim van der Meij
47791a4c80
Merge pull request #18236 from Snuffleupagus/rm-downloadUrl
Remove the `DownloadManager.downloadUrl` method
2024-06-13 15:44:42 +02:00
calixteman
f8ffc5baeb
Merge pull request #18238 from calixteman/disable_gpu
Add an option to enable/disable hardware acceleration (bug 1902012)
2024-06-12 19:27:07 +02:00
Calixte Denizet
ff6180a4c9 Add an option to enable/disable hardware acceleration (bug 1902012) 2024-06-12 18:41:07 +02:00
Jonas Jenwald
42999e5bef Remove the DownloadManager.downloadUrl method
This method has only a single call-site in the viewer, since it's used as a fallback, and the functionality can be moved into the `DownloadManager.download` method instead.
2024-06-12 13:27:45 +02:00
calixteman
341ff40e74
Merge pull request #18231 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2024-06-11 16:44:02 +02:00
Tim van der Meij
e0a01328f3
Update translations to the most recent versions 2024-06-11 15:13:06 +02:00
Tim van der Meij
8273dcaa81
Fix vulnerabilities in dependency versions
This patch is generated automatically using `npm audit fix`.
2024-06-11 15:11:07 +02:00
Tim van der Meij
866b948226
Update dependencies to the most recent versions 2024-06-11 15:10:22 +02:00
calixteman
361b54ec13
Merge pull request #18228 from calixteman/bug1899804
Don't display annotations with a PMD (barcode stuff) entry (bug 1899804)
2024-06-10 21:47:34 +02:00
Calixte Denizet
e3faa40f0f Don't display annotations with a PMD (barcode stuff) entry (bug 1899804)
There's no specification for that (even if it's possible to have an idea from
the xfa specs) so we just want to hide them in order to avoid to display something
wrong.
2024-06-10 21:01:37 +02:00
calixteman
bb73d2a922
Merge pull request #18219 from calixteman/jpx_fix_big_image
Update our OpenJPEG decoder in order to fix a malloc failure due to big image (bug 1901253)
2024-06-08 14:22:18 +02:00
Calixte Denizet
61398066b9 Update our OpenJPEG decoder in order to fix a malloc failure due to big image (bug 1901253)
It has been fixed in:
5ef68089b5
2024-06-07 17:38:35 +02:00
calixteman
c770e94e36
Merge pull request #18214 from calixteman/bug1900907
[Editor] Support dragging & dropping images on a pdf (bug 1900907)
2024-06-07 15:40:14 +02:00
Calixte Denizet
412e03e576 [Editor] Support dragging & dropping images on a pdf (bug 1900907) 2024-06-07 14:26:01 +02:00
Tim van der Meij
b557fba118
Merge pull request #18217 from Snuffleupagus/inline-finishRendering
Inline the `#finishRendering` helper in `TextLayerBuilder.prototype.render`
2024-06-07 14:16:07 +02:00
Tim van der Meij
593ce96834
Merge pull request #18216 from Snuffleupagus/download-data
Change `DownloadManager.download` to use Uint8Array-data
2024-06-07 14:14:48 +02:00
Jonas Jenwald
f7cbd7d16b Inline the #finishRendering helper in TextLayerBuilder.prototype.render
This helper method is simpler/shorter than it originally was[1] and with recent refactoring so is the `render`-method, hence we can just inline this code now.

---
[1] It used to e.g. dispatch the "textlayerrendered" event.
2024-06-07 13:32:28 +02:00
Jonas Jenwald
66e189c9aa Change DownloadManager.download to use Uint8Array-data
Part of this code is really old and pre-dates general availability of things such as `Blob` and `URL.createObjectURL`. To avoid having to duplicate the Blob-creation in the viewer, we can move this into `DownloadManager.download` instead.

Also, remove a couple of unnecessary `await` statements since the methods in question are synchronous.
2024-06-07 13:23:02 +02:00
calixteman
6a71f692bf
Merge pull request #18205 from calixteman/openjpeg_bsd2
Change openjpeg.js license from Apache 2 to BSD 2-clause
2024-06-04 21:27:35 +02:00
Calixte Denizet
e7749443a7 Change openjpeg.js license from Apache 2 to BSD 2-clause 2024-06-04 21:22:48 +02:00
calixteman
21e622769b
Merge pull request #18204 from calixteman/issue16782
Fix decoding of JPX images having an alpha channel
2024-06-03 21:21:52 +02:00
Calixte Denizet
196affd8e0 Fix decoding of JPX images having an alpha channel
When an image has a non-zero SMaskInData it means that the image
has an alpha channel.
With JPX images, the colorspace isn't required (by spec) so when we
don't have it, the JPX decoder will handle the conversion in RGBA
format.
2024-06-03 20:08:11 +02:00
calixteman
5c51d56223
Merge pull request #18167 from calixteman/decompress_image
Decompress when it's possible images in using DecompressionStream
2024-06-02 16:08:19 +02:00
Calixte Denizet
9654ad570a Decompress when it's possible images in using DecompressionStream
Getting images is already asynchronous, so we can use this opportunity
to use DecompressStream (which is async too) to decompress images.
2024-06-02 14:00:05 +02:00
Tim van der Meij
53dfb5a6ba
Merge pull request #18197 from timvandermeij/gulp-5
Upgrade `gulp` to version 5.0.0
2024-06-01 16:16:31 +02:00
calixteman
309d940c3a
Merge pull request #18189 from calixteman/bug1895050
Switch to page-scrolling mode when the pdf has more than 10000 pages (bug 1895050)
2024-05-31 16:03:31 +02:00
Calixte Denizet
018649f13b Switch to page-scrolling mode when the pdf has more than 10000 pages (bug 1895050) 2024-05-31 15:35:26 +02:00
Tim van der Meij
d25b52702a
Upgrade gulp to version 5.0.0
This is a major version bump, and the changelog at
https://github.com/gulpjs/gulp/releases/tag/v5.0.0 indicates one
breaking change that impacts us, namely that streams are now by default
interpreted/transformed to UTF-8 encoding. This breaks `gulp.src` calls
that work on binary files such as images or CMaps, but is fortunately
easy to fix for us by disabling re-encoding for all `gulp.src` calls
(see https://github.com/gulpjs/gulp/issues/2764#issuecomment-2063415792
for more information). This restores the previous behavior of copying
the files as-is without Gulp performing any transformations to it, which
is what we want because Gulp is only used for bundling and we make sure
that the source files have the right encoding.
2024-05-31 14:59:11 +02:00
calixteman
4d9c25a41a
Merge pull request #18193 from calixteman/rm_observer
Disconnect the resize observer and remove scroll listener when unbinding window events
2024-05-30 22:51:05 +02:00
Calixte Denizet
4430b6b703 Disconnect the resize observer and remove scroll listener when unbinding window events 2024-05-30 22:09:52 +02:00
Tim van der Meij
ea34e5ccf6
Merge pull request #18192 from calixteman/bump_4.4
Bump library version to 4.4
2024-05-30 19:05:56 +02:00
Calixte Denizet
648a2d8057 Bump library version to 4.4 2024-05-30 18:56:13 +02:00
calixteman
fdb3617e0f
Merge pull request #18163 from calixteman/simplify_list_points
[api-minor] Simplify how the list of points are structured
2024-05-30 18:25:50 +02:00
Tim van der Meij
0ac4b34c66
Merge pull request #18183 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2024-05-30 15:46:07 +02:00
Calixte Denizet
6fa98ac99f [api-minor] Simplify how the list of points are structured
Instead of sending to the main thread an array of Objects for a list of points (or quadpoints),
we'll send just a basic float buffer.
It should slightly improve performances (especially when cloning the data) and use slightly less memory.
2024-05-30 15:36:15 +02:00
Tim van der Meij
ea0d2126ea
Update translations to the most recent versions 2024-05-28 19:25:46 +02:00
Tim van der Meij
85c79422cf
Update dependencies to the most recent versions 2024-05-28 19:24:24 +02:00
Tim van der Meij
24e12d515d
Merge pull request #18182 from timvandermeij/bump
Bump the stable version in `pdfjs.config`
2024-05-28 18:48:09 +02:00