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

19052 commits

Author SHA1 Message Date
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
Tim van der Meij
fcea7e7b4b
Bump the stable version in pdfjs.config 2024-05-28 18:44:56 +02:00
Jonas Jenwald
0cec644372
Merge pull request #18179 from nicolo-ribaudo/zooming-utilities
[api-minor] Simplify API to implement zoom in custom viewers
2024-05-28 16:39:06 +02:00
Tim van der Meij
027ada81a7
Merge pull request #18170 from Snuffleupagus/TextLayerBuilder-rm-setTextContentSource
[api-minor] Remove the `setTextContentSource` method in `TextLayerBuilder` (PR 18104 follow-up)
2024-05-28 16:38:52 +02:00
Nicolò Ribaudo
b7933d8750
Add origin parameter to updateScale
This parameter allows defining which point should remain
fixed while scaling the document. It can be used, for example,
to implement "zoom around the cursor" or "zoom around
pinch center".

The logic was previously implemented in `web/app.js`, but
moving it to the viewer scaling utilities themselves makes it
easier to implement similar zooming functionalities in
other embedders.
2024-05-28 16:19:47 +02:00
Tim van der Meij
ee545930ea
Merge pull request #18171 from Snuffleupagus/move-pendingTextLayers
Don't register a pending `TextLayer` until `render` is invoked (PR 18104 follow-up)
2024-05-28 15:37:51 +02:00
Nicolò Ribaudo
161c7045f6
Unify increaseScale/decreaseScale logic as updateScale
`updateScale` receives a `drawingDelay`, a `scaleFactor` and/or a number of `steps`.
If `scaleFactor` is a positive number different from `1` the current scale is multiplied by
that number. Otherwise, if `steps` if a positive integer the current scale is multiplied by
`DEFAULT_SCALE_DELTA` `steps` times. Finally, if `steps` is a negative integer, the
current scale is divided by `DEFAULT_SCALE_DELTA` `abs(steps)` times.
2024-05-28 14:02:39 +02:00
Tim van der Meij
aac738c805
Merge pull request #18169 from Snuffleupagus/worker-shorter-code
Slightly shorten some worker-thread code
2024-05-28 13:36:05 +02:00
Tim van der Meij
401a1d4a34
Merge pull request #18161 from Snuffleupagus/types-ES2022
Target ES2022 when building the TypeScript definitions (issue 17932)
2024-05-28 13:28:22 +02:00
calixteman
95a7de9f98
Merge pull request #18174 from calixteman/make_dialog_css
Move the dialog css stuff in its own file
2024-05-28 11:26:49 +02:00
Calixte Denizet
697255d7cc Move the dialog css stuff in its own file
In order to share common parts between different dialogs, this patch
aims to slightly refactor the css in making it more generic.
This way it'll simplify adding a new dialog (we want to add a new one when
leaving an unsaved document).
2024-05-27 22:25:18 +02:00
calixteman
4bdc75f18d
Merge pull request #18165 from calixteman/integrationtest_switch_foo
Simplify the integration test in adding a function to turn on/off an editing tool
2024-05-27 12:00:25 +02:00
Calixte Denizet
b6b02ccff6 Simplify the integration test in adding a function to turn on/off an editing tool 2024-05-27 11:33:52 +02:00
Jonas Jenwald
f2e7eee00e Don't register a pending TextLayer until render is invoked (PR 18104 follow-up)
After the re-factoring in PR 18104 there's now a *theoretical* risk that a pending `TextLayer` is never removed, which we can avoid by not registering it until `render` is invoked.
Note that this doesn't affect the viewer or tests, but if a third-party user calls `new TextLayer(...)` without a following call of either the `render`- or `cancel`-method we'd block global clean-up without this patch.
2024-05-26 18:38:40 +02:00
Jonas Jenwald
303e793264 Introduce a helper method, in PDFPageView, for dispatching "...layerrendered" events
Currently we repeat virtually the same, with the exception of the name, event dispatching code four times for the different viewer layers.
2024-05-26 12:44:06 +02:00
Jonas Jenwald
db86f8132e [api-minor] Remove the setTextContentSource method in TextLayerBuilder (PR 18104 follow-up)
The `setTextContentSource` functionality is very old code, and was introduced years ago together with streaming of textContent.
By moving the `streamTextContent`-call into the `TextLayerBuilder` class we collect more functionality in one place and slightly reduce the amount of code needed.
2024-05-26 12:43:59 +02:00