4276 Commits

Author SHA1 Message Date
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
Gaurang Bhatia
ac8d80a8e4 Fix infinite loop in JBIG2 decoder with >4 referred-to segments and add regression test 2025-12-07 06:46:16 +05:30
Ujjwal Sharma
3a85770af1 Encode FontPath data into an ArrayBuffer
Serialize FontPath commands into a binary format
and store it in an ArrayBuffer so that it can
eventually be stored in a SharedArrayBuffer.
2025-12-06 03:00:48 +05:30
calixteman
36de2d976d
Merge pull request #20476 from calixteman/thumbnail_scroll
Use HTMLElement.scrollIntoView when showing a thumbnail
2025-12-05 09:59:11 +01:00
calixteman
79c72f2c9a
Inject the text from the text layer in the MathML tags when they're in the struct tree (bug 1998046)
This way, the screen readers can read the math content properly.
The elements in the text layer will also have aria-hidden="true"
to avoid duplication.
2025-12-04 22:13:26 +01:00
Calixte Denizet
f9b857463b
Use HTMLElement.scrollIntoView when showing a thumbnail 2025-12-03 15:51:34 +01:00
Weismann
365cc69cae Extend getGlyphMapForStandardFonts with some Russian entries (issue 20453) 2025-12-01 10:21:27 +08:00
calixteman
87b3b5212e
Aria-hide the text content part of a MathML formula (bug 1998046)
It'll avoid to have the text content and the MathML content read by
screen readers.
2025-11-30 22:21:37 +01:00
Calixte Denizet
423379e42f
Slightly reduce the memory used by thumbnails
In using a blob instead of a base64 string it's possible to reduce the memory.
And simplify a bit the thumbnails themselves.
2025-11-28 21:52:40 +01:00
calixteman
925fc3d8f2
Merge pull request #20467 from calixteman/make_sidebar
Create a sidebar object
2025-11-28 16:27:44 +01:00
Calixte Denizet
45578aa8f5
Create a sidebar object
For now its use is limited to the comment sidebar but it'll be used for the new one
containing the thumbnails.
And make the sidebar more accessible with the keyboard or a screen reader.
2025-11-28 16:22:26 +01:00
Calixte Denizet
b6fcb523c5
[Editor] Allow to save an edited comment in using CTRL+Enter shortcut. 2025-11-24 20:20:31 +01:00
calixteman
ec71e4ed65
Merge pull request #20455 from calixteman/bug1998843
[XFA] Set default max value in occur tag to -1 (bug 1998843)
2025-11-22 20:59:04 +01:00
calixteman
d4b6464675
Merge pull request #20456 from calixteman/issue20225
When searching for a group of punctuation signs, only add extraspaces around the group
2025-11-22 15:25:25 +01:00
calixteman
b41959bde8
Merge pull request #20413 from sachiniyer/siyer/fix-annotation-editor-deletion
fix: deleteAnnotationElement takes a full editor object
2025-11-21 22:28:06 +01:00
Sachin Iyer
464dae11ac fix: deleteAnnotationElement takes a full editor object 2025-11-21 11:32:29 -08:00
Calixte Denizet
039b9e4df3 When searching for a group of punctuation signs, only add extraspaces around the group
It fixes #20225.

And only add the extra spaces where it's required depending on their position in the query string.
2025-11-21 18:59:37 +01:00
Calixte Denizet
516aea5562 [XFA] Set default max value in occur tag to -1 (bug 1998843) 2025-11-21 17:53:38 +01:00