Calixte Denizet
86d58b637f
Don't add an undefined id to the span for marked content
...
It fixes #20102 .
2025-07-17 19:13:30 +02:00
Calixte Denizet
636ff503ff
[Editor] Add the possibility to add Popup annotations (bug 1976724)
...
It's a first big step.
This patch contains a new modal dialog to let the user edit/update a Popup
2025-07-15 22:39:16 +02:00
calixteman
4f2390a607
Merge pull request #20070 from calixteman/editor_toolbar_color
...
[Editor] Add a color picker in the toolbar of Ink and Freetext annotations
2025-07-14 23:55:51 +02:00
Calixte Denizet
dbd6f8cdd4
[Editor] Add a color picker in the toolbar of Ink and Freetext annotations
2025-07-14 23:00:01 +02:00
calixteman
ac2a0c5080
Merge pull request #20085 from calixteman/bug1975719
...
Handle the case where all the image data are in the alpha channel (bug 1975719)
2025-07-14 22:44:19 +02:00
Tim van der Meij
64b150f78f
Merge pull request #20077 from calixteman/remove_popup
...
[Editor] Remove a popup from the DOM when it's deleted
2025-07-12 15:25:49 +02:00
Calixte Denizet
6f8796d2c8
Handle the case where all the image data are in the alpha channel (bug 1975719)
...
and add an error message in case where there is no data in the image.
2025-07-11 22:34:37 +02:00
Calixte Denizet
b07914843b
[Editor] Remove a popup from the DOM when it's deleted
2025-07-11 21:55:14 +02:00
Tim van der Meij
e853a8f41a
Merge pull request #20081 from calixteman/signature_description
...
Add the l10n parameter when pasting a Signature annotation
2025-07-11 20:27:06 +02:00
Calixte Denizet
1c15ba7789
Use the canvas context from mozPrintCallback when printing a pdf from the Firefox viewer
...
The context is specific to the callback and cannot be created from the canvas itself.
2025-07-11 12:55:39 +02:00
Calixte Denizet
0f504d9a1a
Add the l10n parameter when pasting a Signature annotation
2025-07-10 21:01:24 +02:00
calixteman
1b427a3af5
Merge pull request #20016 from ryzokuken/move-getcontext
...
[api-minor] Move getContext call to InternalRenderTask
2025-07-08 22:20:19 +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
Tim van der Meij
cbeef3233f
Merge pull request #20056 from calixteman/one_click
...
[Editor] Allow to change the editor mode when selecting the corresponding editor (bug 1975538)
2025-07-06 19:35:31 +02:00
Ujjwal Sharma
b1b728d47f
[api-minor] Move getContext call to InternalRenderTask
...
This is a precursor to moving the call into a
worker thread to let us use `OffscreenCanvas`. The
current position wouldn't work since we make
transformations to the canvas object after the
getContext call, which isn't allowed for
OffscreenCanvas. Also it isn't allowed to clone or
`transferControlToOffscreen` the canvas after the
`getContext` call.
2025-07-04 00:53:51 +02:00
Calixte Denizet
6d2c6cfc9f
[Editor] Allow to change the editor mode when selecting the corresponding editor (bug 1975538)
...
For example, selecting an ink editor just after having created a freetext will switch to ink mode.
2025-07-03 23:27:34 +02:00
calixteman
2d0ba7db08
Merge pull request #20043 from yyliu12/popup-rotation-fix
...
Make Popup annotations always have noRotate flag set as true
2025-07-03 17:27:40 +02:00
Calixte Denizet
c22a425b04
[Editor] When an annotation is added, announce it if the user is using a screen reader (bug 1975264)
2025-07-03 16:53:01 +02:00
Yuyang Liu
d8ecfad8bd
Make Popup annotations always have noRotate flag set as true
...
Necessary because when there is no Popup annotation created along
with a Text annotation, the Popup annotation created by pdf.js
does not receive the noRotate flag
2025-07-03 05:52:31 +09: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
Tim van der Meij
8fe9db0fb5
Merge pull request #20022 from calixteman/color_picker_a11y
...
[Editor] Fix the accessibility of the dropdown in the color picker
2025-06-22 14:23:20 +02:00
Tim van der Meij
ac399e77e8
Merge pull request #20023 from calixteman/edit_added_annotation
...
[Editor] When editing mode is disabled, allow to double click on a added annotation to edit it
2025-06-21 16:23:56 +02:00
calixteman
c7796c7f8d
Merge pull request #19993 from calixteman/editor_toolbar_simplification
...
Slightly simplify the way to create the editor toolbar
2025-06-20 21:59:01 +02:00
calixteman
e78575e593
Merge pull request #19986 from calixteman/dont_show_empty_popup
...
Only show popups when they've some contents to display
2025-06-20 13:48:30 +02:00
Calixte Denizet
b97cee2ab5
Correctly handle files with a hash sign in their names (bug 1894166)
...
It fixes #19990 .
2025-06-20 09:21:41 +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
2548405401
Slightly simplify the way to create the editor toolbar
2025-06-19 23:03:06 +02:00
Calixte Denizet
d0b0064643
[Editor] When editing mode is disabled, allow to double click on a added annotation to edit it
...
It's already possible but only when double clicking outside the the text layer.
This patach adds the possibility to click on the text layer.
2025-06-19 21:15:08 +02:00
Calixte Denizet
1f2e9e5c0f
[Editor] Fix the accessibility of the dropdown in the color picker
2025-06-19 20:08:33 +02:00
Calixte Denizet
96216de410
Only show popups when they've some contents to display
...
Chrome, Edge and Acrobat do that.
2025-06-19 16:33:52 +02:00
calixteman
5653458b51
Merge pull request #20013 from calixteman/fix_annotation_tabindex
...
Make annotations focusable just after the text layer
2025-06-19 14:09:27 +02:00
Calixte Denizet
0d995fa089
Make annotations focusable just after the text layer
2025-06-16 19:06:13 +02:00
Calixte Denizet
27a81c506e
Move the popup annotation in the DOM just after the element triggering it
2025-06-16 14:42:44 +02:00
calixteman
d63aabd662
Merge pull request #19969 from calixteman/editor_inconsistencies
...
[Editor] Change mode when double clicking on an editor
2025-05-28 18:00:26 +02:00
Calixte Denizet
47e69e93a3
[Editor] Change mode when double clicking on an editor
...
It was only possible to double click on a FreeText editor while being in ink mode (or any other).
2025-05-28 17:49:16 +02:00
Jonas Jenwald
e91b480c09
Move the PDFObjects class to its own file
...
This isn't directly part of the official API, and having this class in its own file could help avoid future changes (e.g. issue 18148) affecting the size of the `src/display/api.js` file unnecessarily.
2025-05-20 13:47:36 +02:00
Jonas Jenwald
0105237af6
Move a few helper functions/classes out of the src/display/api.js file
...
Given that this file represents the official API, it's difficult to avoid it becoming fairly large as we add new functionality. However, it also contains a couple of smaller (and internal) helpers that we can move into a new utils-file.
Also, we inline the `DEFAULT_RANGE_CHUNK_SIZE` constant since it's only used *once* and its value has never been changed in over a decade.
2025-05-20 13:47:36 +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
Tim van der Meij
f6e4b1cf4a
Merge pull request #19945 from Snuffleupagus/NetworkStream-rm-Node-Error
...
Remove Node.js-specific checks when using the Fetch API
2025-05-18 12:05:13 +02:00
Jonas Jenwald
a882195e9b
Remove Node.js-specific checks when using the Fetch API
...
Given that Node.js has full support for the Fetch API since version 21, see the "History" data at https://nodejs.org/api/globals.html#fetch , it seems unnecessary for us to manually check for various globals before using it.
Since our primary development target is browsers in general, and Firefox in particular, being able to remove Node.js-specific compatibility code is always helpful.
Note that we still, for now, support Node.js version 20 and if the relevant globals are not available then Errors will instead be thrown from within the `PDFFetchStream` class.
2025-05-18 10:49:02 +02:00
Jonas Jenwald
99b23ea1f6
Use private fields in the PDFDataRangeTransport class
2025-05-18 10:16:46 +02:00
Jonas Jenwald
fc697b3602
Utilize private fields and methods more in the PDFWorker class
...
This replaces, wherever possible, the old semi-private fields and methods with actually private ones.
2025-05-17 18:05:49 +02:00
Jonas Jenwald
ab672f0b77
Replace PDFWorker.fromPort with a generic PDFWorker.create method
...
This allows us to simply invoke `PDFWorker.create` unconditionally from the `getDocument` function, without having to manually check if a global `workerPort` is available first.
2025-05-17 16:13:41 +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
Jonas Jenwald
e5e9d18289
Allow using the workerPort option in Firefox
2025-05-15 19:30:43 +02:00
Calixte Denizet
d6605674dd
[Editor] Keep aspect ratio when rescaling an image before being processed for a signature (bug 1962819)
2025-05-13 19:12:17 +02:00
Jonas Jenwald
d5c534fb83
Reduce duplication when computing the maximum canvas pixels
...
*This is something that occurred to me when reviewing the latest PDF.js update in mozilla-central.*
Currently we duplicate essentially the same code in both the `OutputScale.prototype.limitCanvas` and `PDFPageDetailView.prototype.update` methods, which seems unnecessary, and to avoid that we introduce a new `OutputScale.capPixels` method that is used to compute the maximum canvas pixels.
2025-05-10 20:12:38 +02:00
Calixte Denizet
1225c1e39a
Add a pref in order to cap the canvas area to a factor of the window one (bug 1958015)
...
This way it helps to reduce the overall canvas dimensions and make the rendering faster.
The drawback is that when scrolling, the page can be blurry in waiting for the rendering.
The default value is 200% on desktop and will be 100% for GeckoView.
2025-05-09 13:57:16 +02:00