Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document edits performed by embedded JavaScript fail #13269

Closed
leezu opened this issue Apr 19, 2021 · 1 comment
Closed

Document edits performed by embedded JavaScript fail #13269

leezu opened this issue Apr 19, 2021 · 1 comment
Assignees

Comments

@leezu
Copy link

leezu commented Apr 19, 2021

Firefox 88 release notes specify "support JavaScript embedded in PDF files". Attached document uses JavaScript to automate certain tax calculations on common US tax forms. Unfortunately, pdf.js fails to input the calculated results into the fields.

PDF file: f1040v2.pdf from https://www.pdftax.com/

Configuration:

  • Web browser and its version: Firefox 88

Steps to reproduce the problem:

  1. On page 1, click " I have read and agree to the terms of the Pdftax Software License Agreement" checkbox
  2. On page 1, enter any number or letter in "Enter code in box to the right to get the printable and fileable version"

What is the expected behavior? (add screenshot)
image
via https://code-industry.net/masterpdfeditor/ on Linux (though Adobe Reader on Windows would produce the same result)

What went wrong? (add screenshot)
image

The box in the lower left corner was not filled the number entered in step 2.
The same is true for any tax calculations performed in the form on the following pages.

@calixteman
Copy link
Contributor

The issue is mostly a dup of #13132, so the pdf can be open in Firefox 89 (beta) or https://mozilla.github.io/pdf.js/web/viewer.html.
There few others bugs in it:

  • app.alert({cMsg...} doesn't work correctly;
  • some text fields are not updated because they have the same name as an other field;
  • valueAsString is not set before running calculate actions.

@calixteman calixteman self-assigned this Apr 20, 2021
calixteman added a commit to calixteman/pdf.js that referenced this issue Apr 20, 2021
  - app.alert and few other function can use an object as parameter ({cMsg: ...});
  - support app.alert with a question and a yes/no answer;
  - update field siblings when one is changed in an action;
  - stop calculation if calculate is set to false in the middle of calculations;
  - get a boolean for checkboxes when they've been set through annotationStorage instead of a string.
calixteman added a commit to calixteman/pdf.js that referenced this issue May 4, 2021
  - app.alert and few other function can use an object as parameter ({cMsg: ...});
  - support app.alert with a question and a yes/no answer;
  - update field siblings when one is changed in an action;
  - stop calculation if calculate is set to false in the middle of calculations;
  - get a boolean for checkboxes when they've been set through annotationStorage instead of a string.
calixteman added a commit to calixteman/pdf.js that referenced this issue May 4, 2021
  - app.alert and few other function can use an object as parameter ({cMsg: ...});
  - support app.alert with a question and a yes/no answer;
  - update field siblings when one is changed in an action;
  - stop calculation if calculate is set to false in the middle of calculations;
  - get a boolean for checkboxes when they've been set through annotationStorage instead of a string.
brendandahl added a commit that referenced this issue May 5, 2021
[JS] Fix several issues found in pdf in #13269
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants