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
Tim van der Meij
8b4fae0a84
Merge pull request #20482 from Uzair-Ahmed-Shah/fix-issue-20420
...
Fix #20420 : Prevent double decoding of file URL parameter
2025-12-13 14:22:47 +01:00
Tim van der Meij
4af193bbfc
Merge pull request #20491 from nicolo-ribaudo/move-text-scaling-logic-to-css
...
Move text layer scaling logic to CSS
2025-12-11 20:53:14 +01:00
Tim van der Meij
d946f05841
Merge pull request #20440 from Gaurang-5/master
...
Fix infinite loop in JBIG2 decoder with >4 referred-to segments
2025-12-09 20:42:51 +01:00
Nicolò Ribaudo
eb2b7c2c86
Move text layer scaling logic to CSS
...
This commit moves all the logic to scale up&down `<span>`s in the text
layer, introduced in #18283 , to CSS.
The motivation for this change is that #18283 is still not enough for
all cases. That PR fixed the problem in Chrome&Firefox desktop, which
allow users to set an actual minimum font size in the browser settings.
However, other browsers (e.g. the Chrome-based WebView on Android) have
more complex logic and they scale up small text rather than simply
applying a minimum.
A workaround for that behavior is probably out of scope for PDF.js
itself as it only affects not officially supported platforms. However,
having access to the actual expected font height (through
`--font-height`) allows embedders of PDF.js to implement a workaround by
themselves.
2025-12-09 13:12:20 +01:00
Uzair-Ahmed-Shah
a25448502d
Fix #20420 : Prevent double decoding of file URL parameter
2025-12-08 22:37:52 +05:30
calixteman
f75812b0af
Merge pull request #20346 from ryzokuken/binary-fontpath
...
Encode FontPath data into an ArrayBuffer
2025-12-08 13:59:23 +01:00
Tim van der Meij
de5709a7cd
Merge pull request #20454 from xiaobai2017666/russian-char
...
Extend getGlyphMapForStandardFonts with some Russian entries (issue 20453)
2025-12-07 18:28:41 +01:00