calixteman
30fdf16071
Merge pull request #20354 from Aditi-1400/use-enum
...
Use enums instead of string for mesh shading figure type
2025-10-10 18:49:50 +02:00
calixteman
0d8a300777
Merge pull request #20353 from calixteman/improve_intersector
...
[Annotation] Improve the performance of the code for getting glyphs which belongs to annotations bounding boxes (bug 1987914)
2025-10-10 13:31:03 +02:00
Calixte Denizet
c4d436764c
[Annotation] Improve the performance of the code for getting glyphs which belongs to annotations bounding boxes (bug 1987914)
...
Instead of looking at every bbox, we use a grid (64x64) where each cell of the grid is associated with the bboxes
touching it.
In order to get the potential bboxes containing a point, we just have to compute the number of the cell containing
it and in using the associated described above, we can quickly know if the point is contained.
With the pdf in the mentioned bug, it's ~20 times faster.
2025-10-10 13:28:18 +02:00
Aditi
e8d08c941c
Use enums instead of string for mesh shading figure type
2025-10-10 04:21:03 +05:30
Calixte Denizet
9797dc0eb4
Improve performance of the struct tree build (bug 1987914)
...
For the pdf in bug 1987914, the overall time spent in `addTopLevelNode` is dropping from ~6s to ~70ms.
2025-10-09 16:08:56 +02:00
Calixte Denizet
19ff148163
Fix incremental saving with hybrid references
...
This patch removes some previous fixes which are now likely fixed by #17636 .
Fixes #20302 .
2025-10-04 18:31:55 +02:00
Calixte Denizet
4d15bfec0d
Only apply word spacing when there is a 0x20 in the text chunk
...
Fixes #20319 .
2025-10-03 22:18:02 +02:00
calixteman
3234912c86
Merge pull request #20224 from james-atticus/improve-serif-fallback-font-name-matching
...
Improve serif fallback font name matching
2025-10-01 19:58:13 +02:00
Ujjwal Sharma
4bed7370f4
[WIP] Serialize font data into an ArrayBuffer
...
This PR serializes font data into an ArrayBuffer
that is then transfered from the worker to the
main thread. It's more efficient than the current
solution which clones the "export data" object
which includes the font data as a Uint8Array.
It prepares us to switch to a SharedArrayBuffer
in the future, which would allow us to share
the font data with multiple agents, which would be
crucial for the upcoming "renderer" worker.
2025-09-19 12:02:40 +05:30
James Fitzsimmons
ae8f8e4d34
Improve serif fallback font name matching
2025-09-18 14:15:41 +10:00
Calixte Denizet
b6d772d71d
Consider a ttf font with both Symbolic and Nonsymbolic flags set with a Differences array in the encoding dict as non-symbolic
...
It fixes #20232 .
2025-09-14 18:52:16 +02:00
Calixte Denizet
2d5794f79d
[Editor] Fix saving a deleted popup
2025-09-08 15:36:41 +02:00
Calixte Denizet
af144be3ba
Don't iterate over all empty slots in the xref entries (bug 1980958)
2025-08-25 14:02:08 +02:00
Calixte Denizet
ebc3411727
Use the cached annotations when collecting them by types
2025-08-21 18:04:00 +02:00
Calixte Denizet
9e5ee1e5a7
[Editor] Add the ability to get all the editable annotations in a pdf document
...
We want to be able to show all the comments in a pdf even if the pages where they are
haven't been rendered.
And it'll help to fix the issue #18915 .
2025-08-18 21:31:11 +02:00
Calixte Denizet
1d4ae786f4
Check the setDash arguments
...
It fixes #20155 .
2025-08-09 22:34:44 +02:00
宋铄运 (Alan Song)
3d9374e02e
lazy initialize IccColorSpace.#finalizer
2025-08-05 22:29:32 +00:00
Calixte Denizet
57ce4f8f43
Use a HTML date/time input when a field requires a date or a time.
...
The user will be able to enter a date in the format corresponding to their locale
and it'll be formatted in using the format provided by the pdf.
2025-07-24 22:01:45 +02:00
Calixte Denizet
78391ed85a
Fix the xref table with the values we've at the beginning of a xref stream (bug 1978317)
2025-07-22 22:10:23 +02:00
Calixte Denizet
f695e0ca62
Make the link annotations correctly announced by screen readers (bug 1708041)
...
And focus the targeted page when the user clicks on a link.
2025-07-18 20:15:31 +02:00
Calixte Denizet
8fc51dc089
[Editor] Add the possibility to add a popup to an annotation when saving
...
When saving/printing, only update the properties which are provided and set
a default value only when there is no pre-existing one.
2025-07-11 21:42:21 +02:00
calixteman
0e2b59e3d5
Merge pull request #20064 from calixteman/dict_api
...
Add few methods to the Dict class in order to simplify the code when writing an annotation
2025-07-08 22:16:57 +02:00
calixteman
481b74a1c2
Merge pull request #20063 from calixteman/issue20062
...
Fix the default appearance of a Polygon annotation when a fill color is provided
2025-07-08 22:10:52 +02:00
Calixte Denizet
63b37b4371
Add few methods to the Dict class in order to simplify the code when writing an annotation
2025-07-08 21:23:29 +02:00
Calixte Denizet
ecc7096a80
Fix the default appearance of a Polygon annotation when a fill color is provided
...
It fixes #20062 .
2025-07-08 20:51:58 +02:00
Tim van der Meij
b999d5ce58
Merge pull request #20060 from noritaka1166/fix-typos
...
Fix typos across the codebase
2025-07-08 18:28:52 +02:00
Calixte Denizet
bb52a440ce
Use the creation date in the popup when there is no modification date
...
Remove the h1 element in popup title because it caused a warning in Firefox and use a span instead.
2025-07-07 10:51:35 +02:00
Noritaka Kobayashi
fa568e826d
Fix typos across the codebase
2025-07-07 09:59:36 +09:00
Calixte Denizet
194e2ede4d
Add some telemetry in order to know what are the certificates used in pdfs (bug 1973573)
2025-06-24 22:23:29 +02:00
Calixte Denizet
3bdc5d54fe
Get the text under highlight/squiggly/underline/strikethrough annotations (bug 1885505)
...
and add an invisible element containing the text in the annotation layer to make
it readable by a screen reader.
2025-06-22 21:47:29 +02:00
Calixte Denizet
2541d96bf5
[JS] Make the date parser less strict
...
and display the expected date formt as a tooltip.
2025-06-20 08:57:07 +02:00
Calixte Denizet
14f0e88910
Fix a printing issue on Mac (bug 1961423)
...
On mac, the pdf backend used when printing is using the cid from the font,
so if a char has null cid then it's equivalent to .notdef and some viewers
don't display it.
2025-06-07 21:33:17 +02:00
Tim van der Meij
d90ec29b4d
Merge pull request #19964 from Snuffleupagus/core-catalog-private
...
Replace semi-private fields/methods with actual private ones in `src/core/catalog.js`
2025-05-24 14:16:06 +02:00
Jonas Jenwald
c5449a98e0
Ignore empty paths when optimizing constructPath operations (issue 19971)
...
Note how we're handling empty paths in [src/display/canvas.js](a8e05d82e2/src/display/canvas.js (L1423-L1428) ), hence we need add similar code in the `QueueOptimizer` as well.
2025-05-23 13:59:05 +02:00
Jonas Jenwald
a90e46bdc9
Use nullish coalescing in the Catalog.prototype.numPages getter
2025-05-21 16:47:20 +02:00
Jonas Jenwald
0d2ab3c709
Replace semi-private fields/methods with actual private ones in src/core/catalog.js
...
Additionally, move a couple of "public" fields out of the class constructor and initialize them directly instead.
2025-05-21 12:10:07 +02:00
calixteman
fc68a9f3ee
Merge pull request #19958 from calixteman/rm_useless_subarray_flate_stream
...
Don't create a useless subarray when getting image data from a flate stream
2025-05-19 19:29:25 +02:00
calixteman
f148106cb1
Merge pull request #19957 from calixteman/rm_qcms_subarray
...
Remove all the useless subarrays when using qcms.
2025-05-19 17:33:52 +02:00
Jonas Jenwald
36b40d959b
Merge pull request #19955 from Snuffleupagus/issue-19954
...
Support Type3 fonts with an incomplete /FontDescriptor dictionary (issue 19954)
2025-05-19 17:26:46 +02:00
Calixte Denizet
3ecbef516d
Don't create a useless subarray when getting image data from a flate stream
2025-05-19 16:48:23 +02:00
Calixte Denizet
782e883a87
Remove all the useless subarrays when using qcms.
...
It reduces the memory use and the newly added function `getRgbHex` is 4 times faster.
2025-05-19 16:07:57 +02:00
Jonas Jenwald
c02ea0c681
Simplify how we handle Type3 fonts without a /FontDescriptor dictionary
...
Part of this is very old code, which we can now simplify a little bit.
2025-05-19 15:26:11 +02:00
Calixte Denizet
5789afd3f8
Create the css color to use with the canvas in the worker
...
It slightly reduces the time spent to draw and the memory used.
2025-05-19 14:52:24 +02:00
Jonas Jenwald
5f5d9dfc28
Support Type3 fonts with an incomplete /FontDescriptor dictionary (issue 19954)
...
We have a fallback for the common case of Type3 fonts without a /FontDescriptor dictionary, however we also need to handle the case where it's present but lacking the required /FontName entry.
2025-05-19 12:56:14 +02:00
studystill
b585937340
chore: remove redundant word in comment
...
Signed-off-by: studystill <chenghuiyue@outlook.com>
2025-05-16 15:16:26 +08:00
calixteman
ca05a0dbfc
Merge pull request #19911 from calixteman/issue19753
...
Decode appearance keys of checkboxes
2025-05-10 15:01:22 +02:00
Jonas Jenwald
f26f984fa0
Improve validation in the Catalog.prototype.openAction getter
...
When the /OpenAction data is an Array we're currently using it as-is which could theoretically cause problems in corrupt PDF documents, hence we ensure that a "raw" destination is actually valid. (This change is covered by existing unit-tests.)
*Note:* In the Dictionary case we're using the `Catalog.parseDestDictionary` method, which already handles all of the necessary validation.
2025-05-10 11:51:58 +02:00
Calixte Denizet
49a098cb5d
Decode appearance keys of checkboxes
2025-05-09 21:46:17 +02:00
calixteman
293506ada7
Merge pull request #19903 from Snuffleupagus/shorten-fieldObjects-getter
...
Shorten the `PDFDocument.prototype.fieldObjects` getter slightly
2025-05-09 15:49:51 +02:00
Jonas Jenwald
1f7581b5c6
Shorten the PDFDocument.prototype.fieldObjects getter slightly
...
The effect is probably not even measurable, however this patch ever so slightly reduces the asynchronicity in the `fieldObjects` getter. These changes should be safe since:
- We're inside of the `PDFDocument`-class and the `annotationGlobals`-getter, which will always return a (shadowed) Promise and won't throw `MissingDataException`s, can be accessed directly without going through the `BasePdfManager`-instance.
- The `acroForm`-dictionary can be accessed through the `annotationGlobals`-data, removing the need to "manually" look it up and thus the need for using `Promise.all` here.
- We can also lookup the /Fields-data, in the `acroForm`-dictionary, synchronously since the initial `formInfo.hasFields` check guarantees that it's available.
2025-05-07 17:47:09 +02:00