Jonas Jenwald
ecb09d62fc
Add the current loading percentage to the onPassword callback
...
The percentage calculation is currently "spread out" across various viewer functionality, which we can avoid by having the API handle that instead.
Also, remove the `this.#lastProgress` special-case[1] and just register a "normal" `fullReader.onProgress` callback unconditionally. Once `headersReady` is resolved the callback can simply be removed when not needed, since the "worst" thing that could theoretically happen is that the loadingBar (in the viewer) updates sooner this way. In practice though, since `fullReader.read` cannot return data until `headersReady` is resolved, this change is not actually observable in the API.
---
[1] This was added in PR 8617, close to a decade ago, but it's not obvious to me that it was ever necessary to implement it that way.
2026-01-31 16:33:58 +01:00
Jonas Jenwald
4ca205bac3
Add an abstract BasePDFStreamRangeReader class, that all the old IPDFStreamRangeReader implementations inherit from
...
Given that there's no less than *five* different, but very similar, implementations this helps reduce code duplication and simplifies maintenance.
2026-01-30 14:15:39 +01:00
Jonas Jenwald
54d8c5e7b4
Add an abstract BasePDFStreamReader class, that all the old IPDFStreamReader implementations inherit from
...
Given that there's no less than *five* different, but very similar, implementations this helps reduce code duplication and simplifies maintenance.
Also, remove the `rangeChunkSize` not defined checks in all the relevant stream-constructor implementations.
Note how the API, since some time, always validates *and* provides that parameter when creating a `BasePDFStreamReader`-instance.
2026-01-30 14:15:39 +01:00
Jonas Jenwald
4a8fb4dde1
Add an abstract BasePDFStream class, that all the old IPDFStream implementations inherit from
...
Given that there's no less than *five* different, but very similar, implementations this helps reduce code duplication and simplifies maintenance.
Also, spotted during rebasing, pass the `enableHWA` option "correctly" (i.e. as part of the existing `transportParams`) to the `WorkerTransport`-class to keep the constructor simpler.
2026-01-30 14:15:39 +01:00
Jonas Jenwald
814df09e21
Merge pull request #20603 from Snuffleupagus/createChromiumPrefsSchema
...
Improve preferences building, and generate the `preferences_schema.json` file for the Chromium addon
2026-01-30 14:12:27 +01:00
Jonas Jenwald
1370950843
Remove unnecessary IIFEs when setting the compatParams
...
This really isn't necessary, and it's just a left-over from before the code was moved into the current file.
Also, spotted during rebasing, use the existing "locale" hash-parameter in integration-tests rather than adding a duplicate one for testing.
2026-01-30 13:31:16 +01:00
Jonas Jenwald
06cf7dd7b0
Stop pre-building the preference defaults, to simplify the build scripts
...
This is a left-over from before the introduction of `AppOptions`, but is no longer necessary now.
2026-01-30 13:26:19 +01:00
Jonas Jenwald
9c903a0ebc
Remove unit-tests for global ReadableStream and URL
...
These unit-tests were added many years ago, when this functionality wasn't generally available and we still bundled polyfills.
Since they are both available everywhere nowadays, see [here](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream ) and [here](https://developer.mozilla.org/en-US/docs/Web/API/URL ), these unit-tests no longer make sense.
2026-01-30 10:16:21 +01:00
Tim van der Meij
471adfd023
Merge pull request #20596 from Snuffleupagus/FileSpec-fixes
...
Simplify the `FileSpec` class, and remove no longer needed polyfills
2026-01-29 22:03:38 +01:00
Tim van der Meij
c0572c1c8f
Merge pull request #20594 from Snuffleupagus/Node-ReadableStream
...
[Node.js] Don't abort the full request for local PDF files smaller than two range requests, and use standard `ReadableStream`s
2026-01-29 21:48:43 +01:00
Jonas Jenwald
5b368dd58a
Remove the Uint8Array.prototype.toHex(), Uint8Array.prototype.toBase64(), and Uint8Array.fromBase64() polyfills
...
(During rebasing of the previous patches I happened to look at the polyfills and noticed that this one could be removed now.)
See:
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/toHex#browser_compatibility
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/toBase64#browser_compatibility
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/fromBase64#browser_compatibility
Note that technically this functionality can still be disabled via a preference in Firefox, however that's slated for removal in [bug 1985120](https://bugzilla.mozilla.org/show_bug.cgi?id=1985120 ).
Looking at the Firefox source-code, see https://searchfox.org/firefox-main/search?q=array.tobase64%28%29&path=&case=false®exp=false , you can see that it's already being used *unconditionally* elsewhere in the browser hence removing the polyfills ought to be fine (since toggling the preference would break other parts of the browser).
2026-01-29 17:27:43 +01:00
Calixte Denizet
dd6a0c6cf4
Add a manage button in the thumbnail view in order to save an edited pdf (bug 2010830)
2026-01-26 18:09:07 +01:00
Calixte Denizet
806133379e
Refactor a bit page mapping stuff in order to be able to support delete/copy pages
2026-01-26 16:53:52 +01:00
calixteman
48df8a5ea2
Merge pull request #20586 from marco-c/commentundo
...
Bug 1999154 - Add the ability to undo comment deletion
2026-01-26 15:52:15 +01:00
Calixte Denizet
f2ac669ee4
Fix the drag marker dimensions in the thumbnails view
...
STR:
- open outline view;
- switch to thumbnails one;
- start to drag a thumbnail.
2026-01-25 21:49:17 +01:00
calixteman
001058abb2
Merge pull request #20593 from calixteman/decompress_content_stream
...
Use DecompressionStream in async code
2026-01-25 21:27:16 +01:00
calixteman
9f660be8a2
Use DecompressionStream in async code
...
Usually, content stream or fonts are compressed using FlateDecode.
So use the DecompressionStream API to decompress those streams
in the async code path.
2026-01-25 14:22:19 +01:00
Jonas Jenwald
45294d31cb
In Node.js, don't abort the full request for local PDF files smaller than two range requests
...
This follows the behaviour used with both the Fetch API and `XMLHttpRequest`, compare with the `validateRangeRequestCapabilities` helper function.
2026-01-25 12:34:35 +01:00
Tim van der Meij
95f62f3b33
Merge pull request #20580 from calixteman/reorg_link_outline
...
Fix links and outline after reorganizing a pdf
2026-01-23 20:49:20 +01:00
Marco Castelluccio
bfdcaadf7c
Use kbUndo when possible
2026-01-22 13:12:38 +01:00
Marco Castelluccio
bdc9323b15
Hide comment popup after redo action
2026-01-22 13:12:13 +01:00
Marco Castelluccio
84d15dc453
Restore date too
2026-01-21 17:06:13 +01:00
Marco Castelluccio
d9f67bd8ee
Bug 1999154 - Add the ability to undo comment deletion
2026-01-21 15:15:40 +01:00
calixteman
ce296d8d42
Add the possibility to order the pages in an extracted pdf (bug 1997379)
...
or in a merged one.
2026-01-19 18:58:23 +01:00
Calixte Denizet
43bd7fa738
Fix links and outline after reorganizing a pdf
2026-01-19 17:38:17 +01:00
calixteman
8abfd9a797
Avoid exception after having moved an annotation
...
It fixes #20571 .
2026-01-18 21:01:40 +01:00
Calixte Denizet
3a20ea75b9
The 'find in page' feature must correctly work after the pages have been reorganized (bug 2010814)
2026-01-18 20:54:15 +01:00
Calixte Denizet
eb014a36cc
Select the dropped thumbnail (bug 2010820)
2026-01-16 19:54:14 +01:00
Calixte Denizet
5e89981282
Add the possibility to drag & drop some thumbnails in the pages view
...
The goal is to be able to reorganize the pages in a pdf.
2026-01-14 21:04:38 +01:00
Calixte Denizet
cffd54e9c6
Hide the text in the text layer associated with MathML elements (bug 2009627)
...
The bug was supposed to be fixed by #20471 but here there are some annotations in the pdf.
When those annotations are added to the DOM, the struct tree has to be rendered but without
the text layer (because of asynchronicity).
So this patch is making sure that the modifications in the text layer are done once the
layer is rendered.
2026-01-13 20:37:52 +01:00
Calixte Denizet
b5ed988267
Don't use contents stream which have an image format
...
The original bug has been filled in mupdf bug tracker:
https://bugs.ghostscript.com/show_bug.cgi?id=709033
The attached pdf can be open in Chrome but not in Acrobat.
2026-01-13 18:39:17 +01:00
calixteman
1dd6649b7d
Add some tests for the JBIG2 js decoder
...
It fixes #20529 .
The files come from:
https://github.com/SerenityOS/serenity/tree/master/Tests/LibGfx/test-inputs/jbig2/
Thank you to Nico Weber for offering these test files.
2026-01-07 22:05:05 +01:00
Calixte Denizet
da463f2da9
Don't add an aria-label on MathML elements in the struct tree (bug 2004951)
2026-01-06 21:38:42 +01:00
Calixte Denizet
0ef085e23b
Aria-hide artifacts in the text layer (bug 2004951)
2026-01-05 16:57:01 +01:00
Tim van der Meij
adde05b530
Revert "Remove some files from talos tests because they aren't available on webarchive"
...
This reverts commit fbce8bf829cba78281ea93e845c524725ff2c3ff. The file
is available in the Web Archive again.
Fixes #20528 .
2026-01-04 19:29:26 +01:00
calixteman
eab33828a9
Fix wasm url issue for the jbig2 decoder
...
and add a test for jbig2 decoding with the js decoder.
2026-01-04 00:08:59 +01:00
calixteman
98c1955bd4
Use the PDFium JBig2 decoder compiled into wasm
...
The decoder is ~4x faster than the JS decoder on large images.
2026-01-03 22:05:14 +01:00
calixteman
5518c8a544
Use CIDToGIDMap when the font is a type 2 with an OpenType font
...
It fixes #18062 .
2025-12-28 14:51:06 +01:00
Tim van der Meij
1990fa7cd0
Merge pull request #20538 from calixteman/issue13425
...
Fix the loca table length when there is enough space for it
2025-12-28 13:52:32 +01:00
calixteman
22932f7b68
Fix the loca table length when there is enough space for it
...
It fixes #13425 .
2025-12-28 11:21:40 +01:00
calixteman
eaf49c1057
Avoid to have a mail link with string having the format ddd@d.dddd
...
It fixes #20523 .
2025-12-24 19:42:18 +01:00
Tim van der Meij
33e857995c
Merge pull request #20519 from timvandermeij/ink-simplify
...
Introduce a helper function to draw a line in the ink editor integration tests
2025-12-23 15:46:59 +01:00
calixteman
f66575ac72
Merge pull request #20527 from calixteman/rm_talos
...
Remove some files from talos tests because they aren't available on webarchive
2025-12-23 15:35:17 +01:00
calixteman
fbce8bf829
Remove some files from talos tests because they aren't available on webarchive
2025-12-23 15:27:30 +01:00
calixteman
91033c2199
Fix the encoding for some missing chinese fonts
...
It fixes #20489 .
2025-12-23 14:05:27 +01:00
calixteman
fc4985819f
Avoid exception when trying to render some glyphs contours
...
It fixes #20513 .
2025-12-22 23:45:34 +01:00
Tim van der Meij
71140e7d0f
Introduce a helper function to draw a line in the ink editor integration tests
...
This commit extracts the logic to draw a line from one coordinate to
another to both remove code duplication (8% of the total number of lines
in the file are removed) and clarify the intent of the individual tests.
2025-12-22 19:41:39 +01:00
calixteman
923a778d26
Escape punctuation signs in search query
...
It fixes #20516 .
The chars `*{}()[]\` are punctuation signs in regex, so they need to be escaped
when searching for them literally.
2025-12-22 17:41:53 +01:00
Calixte Denizet
8bcbf22ad4
Fix unit tests in adding a comma in the JSON for imports
2025-12-22 16:01:30 +01:00
calixteman
2367196a00
Change the sidebar for a views manager
...
Update the styles and HTML to reflect the new views manager concept.
For now, nothing about split/merge functionality is implemented or visible.
The new styles for the outline, attachments, and layers will be added later.
The thumbnail view is now accessible with the keyboard.
2025-12-15 17:43:52 +01:00