7349 Commits

Author SHA1 Message Date
Calixte Denizet
0ef085e23b
Aria-hide artifacts in the text layer (bug 2004951) 2026-01-05 16:57:01 +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
424c7989aa
Get glyph contours when stroking using a pattern
Fix issue #20513 (second part).
2025-12-28 22:55:59 +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
1dffcf7f25
Remove undefStack stuff in the cff parser
I think it should have been removed with #2527 so it should be useless now.
Because of that stuff, some commands with a wrong number of arguments
weren't stripped out (see the pdf in #13850).
2025-12-27 16:59:29 +01:00
Tim van der Meij
dd6459c3d2
Merge pull request #20525 from calixteman/simplify_gradient
Avoid pattern creation with some basic gradients
2025-12-23 15:44:54 +01:00
calixteman
91033c2199
Fix the encoding for some missing chinese fonts
It fixes #20489.
2025-12-23 14:05:27 +01:00
calixteman
4ff582acbe
Avoid pattern creation with some basic gradients
Some gradients are represented as patterns in PDF.js, because they
mustn't be affected by the current transform. But in most of the cases,
the gradient is attached to the origin and the current transform is very
basic (dilatation + orthogonal + translation). In those cases, we can
avoid creating the pattern because the gradient is transformed into
another gradient when the inverse transform is applied.
2025-12-23 10:36:05 +01:00
calixteman
fc4985819f
Avoid exception when trying to render some glyphs contours
It fixes #20513.
2025-12-22 23:45:34 +01:00
calixteman
ff4529d127
Merge pull request #20492 from nicolo-ribaudo/simplify-markedcontent-text-layer
Simplify positioning of elements inside `markedContent`
2025-12-12 17:29:33 +01:00
calixteman
f824f38e30
Merge pull request #20499 from AtiX/master
Improves text rendering performance by skipping unnecessary pattern calculations
2025-12-12 17:28:22 +01:00
Nicolò Ribaudo
7e0c9395fb
Simplify positioning of elements inside markedContent
By setting `display: contents` on `.markedContent` containers, they stop
affecting the layout of their children. This means that we can always
position text layer `<span>` elements using percentages relative to the
page dimensions, rather than having two separate code paths.

For some reason this breaks the workaround for text selection flickering
in Chrome/Safari, which can be fixed by setting `user-select: text` on
the `.endOfContent` div (only in Chrome/Safari, as it would break
selection in Firefox).
2025-12-12 11:37:45 +01:00
Arthur Silber
9bc4175bde Improves text rendering performance by skipping unnecessary pattern calculations 2025-12-12 07:07:31 +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
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
8e2963ccad
Merge pull request #20226 from lab-core/pointer-type-initialization
[Editor] Pointer type initialization only when the user changes the mode
2025-12-02 20:55:39 +01:00
Weismann
365cc69cae Extend getGlyphMapForStandardFonts with some Russian entries (issue 20453) 2025-12-01 10:21:27 +08:00
Tim van der Meij
40b52fa43a
Merge pull request #20458 from calixteman/fix_firstchild
Don't use firstChild/lastChild when getting elements (follow-up of #20447)
2025-11-27 21:34:56 +01:00
calixteman
029cae2ad4 Don't use firstChild/lastChild when getting elements (follow-up of #20447) 2025-11-22 21:10:32 +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
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
516aea5562 [XFA] Set default max value in occur tag to -1 (bug 1998843) 2025-11-21 17:53:38 +01:00
calixteman
ddf3a989ca
Merge pull request #20427 from Aditi-1400/issue-20426
Add setter for some FontFaceObject properties
2025-11-20 20:49:30 +01:00
Aditi
7743d11594 Add setter for some FontFaceObject properties 2025-11-20 22:47:57 +05:30
calixteman
c6b61a34e6
Merge pull request #20436 from calixteman/merge_struct_trees
Merge the structure trees coming from different pdfs (bug 1997379)
2025-11-17 20:10:06 +01:00
Calixte Denizet
e13a618df3 Merge the structure trees coming from different pdfs (bug 1997379) 2025-11-17 19:56:36 +01:00
Calixte Denizet
50c48cf11b Add telemetry for tagged pdfs (bug 1997134) 2025-11-17 19:47:16 +01:00
calixteman
e7288dca8e
Merge pull request #20431 from calixteman/split_merge_p4
Add a wrapper for the new xref in order to be able to get some values from cloned dictionaries
2025-11-11 21:47:42 +01:00
Tim van der Meij
bc4d90711a
Merge pull request #20432 from calixteman/version
Version entry in the catalog has to be a name and not a string
2025-11-11 20:31:59 +01:00
Calixte Denizet
a98b0b1fb5 Version entry in the catalog has to be a name and not a string 2025-11-09 15:34:57 +01:00
Calixte Denizet
65881f0e21 Add a wrapper for the new xref in order to be able to get some values from cloned dictionaries 2025-11-09 15:28:43 +01:00
Calixte Denizet
37f4712f7e Update the named page destinations when some pdf are combined (bug 1997379)
and remove link annotations pointing on a deleted page.
2025-11-07 18:22:19 +01:00
Calixte Denizet
ad97c5b816 Update the page labels tree when a pdf is extracted (bug 1997379) 2025-11-07 15:59:57 +01:00
calixteman
85ed401b82
Merge pull request #20409 from calixteman/split_merge_p1
Add the possibility to create a pdf from different ones (bug 1997379)
2025-11-07 15:05:52 +01:00
Calixte Denizet
bc87f4e8d6 Add the possibility to create a pdf from different ones (bug 1997379)
For now it's just possible to create a single pdf in selecting some pages in different pdf sources.
The merge is for now pretty basic (it's why it's still a WIP) none of these data are merged for now:
 - the struct trees
 - the page labels
 - the outlines
 - named destinations
For there are 2 new ref tests where some new pdfs are created: one with some extracted pages and an other
one (encrypted) which is just rewritten.
The ref images are generated from the original pdfs in selecting the page we want and the new images are
taken from the generated pdfs.
2025-11-07 14:57:48 +01:00
Calixte Denizet
04db38558a Create the number tree for the ParentTree only one time 2025-11-05 17:49:55 +01:00
legraina
396cff5652
Pointer type initialization only when the user changes the mode
Clear the pointer type of CurrentPointers outside of the DrawingEditor to always keep the same, until the user changes the mode.
One of the goal is to keep the same pointer type in case of a refresh of the page or if the user changes the pdf document.
2025-11-02 08:56:18 -05:00
calixteman
2cc809ade2
Merge pull request #20213 from lab-core/pointer-type
[Editor] A new CurrentPointers class to store current pointers used by the editor
2025-11-01 19:17:32 +01:00
Tim van der Meij
6e7a6eb52b
Merge pull request #20408 from calixteman/fix_mml_encoding
Don't set the MathML namespace for attributes in MathML tags (bug 1997343)
2025-11-01 14:58:15 +01:00
Tim van der Meij
c696648826
Merge pull request #20404 from mozilla/revert-20031-telemetry_signature_certificate
Revert "Add some telemetry in order to know what are the certificates used in pdfs (bug 1973573)"
2025-11-01 14:55:07 +01:00
Calixte Denizet
6db23139be Don't set the MathML namespace for attributes in MathML tags (bug 1997343)
And by default a XML file is UTF-8 encoded so correctly decode the embedded file.
2025-10-30 18:37:19 +01:00