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

Field isn't updated, if you reenter value, that was there when you opened PDF #15753

Closed
Azarchaniel opened this issue Nov 28, 2022 · 4 comments · Fixed by #15764
Closed

Field isn't updated, if you reenter value, that was there when you opened PDF #15753

Azarchaniel opened this issue Nov 28, 2022 · 4 comments · Fixed by #15764
Assignees

Comments

@Azarchaniel
Copy link

Hey,
we have encountered an error with PDF.js. We were able to duplicate it and prepared little demonstration. In the attached PDF, there are two fields: "field1" labeled "Origin field" and "field2" labeled "Calculated field". "field2" takes value from "field1". Now to problem:

HOW TO REPLICATE:
Open PDF in PDF.js. In the field “field1” enter value, let’s say “24”. The fields are calculated. Save the PDF and close. Open it again. In the field “field1“ change the value to “48”. The fields are calculated. Now change it back to “24”. The fields won’t calculate.
Tested in Safari, Firefox, Chrome & Win10, MacOS.

EXPECTED BEHAVIOR:
Calculate every field no matter what was initial value.

error.pdf

@Snuffleupagus
Copy link
Collaborator

WFM, using PDF.js 3.1.73 [8237231] in Firefox Nightly 109 on Windows.

When opening an issue, please provide all of the information requested in https://github.com/mozilla/pdf.js/blob/master/.github/ISSUE_TEMPLATE.md since this isn't really actionable/valid without the Configuration:-section filled out.

@Azarchaniel
Copy link
Author

Config:
Browser: Firefox Developer 108.0b5 / Google Chrome 107.0.5304.108
OS: Windows 10 Pro 21H2 (also tested on Mac and Safari, but can't get versions now)
PDF.js version: "pdfjs-dist": "2.16.105",
Is a browser extension: No

@Snuffleupagus
Copy link
Collaborator

PDF.js version: "pdfjs-dist": "2.16.105",

That version is no longer supported, please find the latest releases at https://mozilla.github.io/pdf.js/getting_started/#download

@donarus
Copy link

donarus commented Nov 28, 2022

@Snuffleupagus Jonas, I have REPRODUCED it using 2.16.05 but also using the latest master branch

git clone https://github.com/mozilla/pdf.js.git # clone official pdf.js master source code
npm install -g gulp-cli
npm install
gulp server
cd test/pdfs
wget https://github.com/mozilla/pdf.js/files/10101473/error.pdf
mv error.pdf issue15753.pdf

in firefox open http://localhost:8888/web/viewer.html?file=/test/pdfs/issue15753.pdf

image

in the "origin field" enter for example XXX and hit enter
image

then modify the string to something not-empty again (eg XXXYYY)
image

then delete all the content of the "origin field" (so put empty string in it) and hit enter ... nothing happens to the second (Calculated field) ... also try to focus (click) the second (calculated field) .. still nothing happens .. field is not recalculated
image

what is even weirder is that when I just change the focus instead of hitting the "ENTER" key, it seems it works.

sharing a video

when hitting enter

hitting_enter.mov

when using focus

using_focus.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants