7338 Commits

Author SHA1 Message Date
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
Edoardo Cavazza
4c22b99df3 Collect all child nodes of lists and tables 2025-10-29 17:30:46 +01:00
calixteman
aeceee1df3
Revert "Add some telemetry in order to know what are the certificates used in pdfs (bug 1973573)" 2025-10-29 15:41:34 +01:00
Coelacanthus
6590063614
Add the font PT Astra Serif as a possible substitution for Times New Roman
Metric-compatible font with Times New Roman created by ParaType, based on
their serif font PT Serif, released under OFL-1.1 license.

https://www.paratype.com/fonts/pt/pt-astra-serif

Signed-off-by: Coelacanthus <uwu@coelacanthus.name>
2025-10-29 17:15:31 +08:00
calixteman
520363b350
Merge pull request #20384 from calixteman/bug1937438
Make MathML elements visible in the struct tree (bug 1937438)
2025-10-23 17:55:42 +02:00
Calixte Denizet
e5a62c8d06 Make MathML elements visible in the struct tree (bug 1937438)
It'll help to make math equations "visible" for screen readers.
MS Office has a specific way to add some MathML code to struc tree leaf
and this patch handles it.
2025-10-23 16:29:01 +02:00
calixteman
638861008f
Merge pull request #20388 from calixteman/bug1995705
[Editor] Avoid to have several Undo entries in the context menu (bug 1995705)
2025-10-23 09:01:19 +02:00
Calixte Denizet
19cbdba434 [Editor] Avoid to have several Undo entries in the context menu (bug 1995705) 2025-10-22 19:45:52 +02:00
calixteman
1a8689b9be
Merge pull request #20340 from Aditi-1400/serialize-pattern-ab
Serialize pattern data into ArrayBuffer
2025-10-22 11:05:22 +02:00
legraina
a932804fb5
A new CurrentPointers class to store current pointers used by the editor
Move current pointer field of DrawingEditor to CurrentPointer class in tools.js: The pointer types fields have been moved to a CurrentPointer object in tools.js. This object is used by eraser.js and ink.js.
Only reset pointer type when user select a new mode: Clear the pointer type when changing mode, instead of at the end of the session. It seems more stable, as the method is not called this way when the user changes pages. Also, clear the pointer type when the mode is changed by an event (the user changes the editor type), otherwise, the same pointer type is kept (the document is changed for example)
2025-10-21 17:00:08 -04:00
Calixte Denizet
9205305dbb Add a highlightSpan function in order to simplify a bit the integration tests 2025-10-19 19:37:41 +02:00
Calixte Denizet
199b3d04df Fix stream use when getting the text (follow-up of #20373) 2025-10-18 22:58:27 +02:00