Calixte Denizet
6369617e6f
[JS] Fix few errors around AFSpecial_Keystroke
...
- @cincodenada found some errors which are fixed in this patch;
- it partially fixes issue #14306 ;
- add some tests.
2022-01-08 12:34:56 +01:00
Jonas Jenwald
c42887221a
Simplify some regular expressions
...
There's a fair number of regular expressions througout the code-base which are slightly more verbose than strictly necessary, in particular:
- We have a lot of regular expressions that use `[0-9]` explicitly, and those can be simplified to use `\d` instead.
- We have one instance of a regular expression containing a `A-Za-z0-9_` sequence, which can be simplified to use `\w` instead.
2021-09-02 11:50:42 +02:00
Jonas Jenwald
ec3bcadf56
Enable the unicorn/no-array-push-push
ESLint plugin rule
...
There's generally speaking no need to use multiple consecutive `Array.prototype.push()` calls, since that method accepts multiple arguments, and this ESLint rule helps enforce that pattern.
Please see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-push-push.md for additional information.
2021-05-25 13:54:46 +02:00
Calixte Denizet
4a5f1d1b7a
JS - Fix setting a color on an annotation
...
- strokeColor corresponds to borderColor;
- support fillColor and textColor;
- support colors on the different annotations;
- fix typo in aforms (+test).
2021-02-20 15:24:37 +01:00
Calixte Denizet
8e6bec6e2e
JS -- Add few missing constants in global scope
...
- these constants are available in pdfium implementation too
- fix error code in aform.js
2021-01-11 17:19:28 +01:00
Calixte Denizet
167ff1a7fc
JS -- Actions must be evaluated in global scope
...
* All the public properties of doc are injected into globalThis, in order to make them available through `this`
* Put event in the global scope too.
2020-12-17 22:01:45 +01:00
Calixte Denizet
f94269c0d1
JS -- add function eMailValidate used to validate an email address
2020-12-10 21:51:37 +01:00
Calixte Denizet
0f899edfc8
JS -- Add aform functions
...
* These functions aren't in the PDF specs but seems to be widely used
* So the specs for these functions are:
* http://www.sfu.ca/~wcs/ForGraham/Aladdin%20stuff/Acrobat%20Reader%205.0/Contents/MacOS/JavaScripts/AForm.js
* pdfium source code
2020-12-07 19:37:34 +01:00
Calixte Denizet
e76a96892a
JS - Add the basic architecture to be able to execute embedded js
2020-10-21 19:00:56 +02:00