-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
[Bug]: Form Field Calculation Triggering Unexpectedly or not getting trigger at all. #18532
Comments
We need to have the pdf to debug the potential issue: without it, it's impossible to guess what's wrong exactly. |
Hi @calixteman |
An empty product should be 0 and not 1: pdf.js/src/scripting_api/aform.js Line 524 in 63371ea
|
@calixteman Will this check resolve the other issue as well? In the PDF snapshot shared by @paritosh-mahale, you can see that the amount is being calculated from the rate by default when we enter the quantity in any row. This is affecting the solution we created using pdf.js. |
In addition to everything said in #18532 (comment), please also note that it's not really "allowed" to report multiple different problems in one issue (since that makes tracking things much more difficult). |
@calixteman and @Snuffleupagus I understand what you said and I am aligned with that. Your time is valuable, and since this is an open-source library, the support we are receiving from you is a significant help for us. The other PDF is restricted and cannot be shared in a public forum. If possible, could we share it via email? This is the last piece pending in our solution, and we are a bit worried about it. Thank you for providing us with this wonderful library. Cheers! |
@calixteman / @Snuffleupagus Here is the attached PDF. We recreated it without restrictions. |
Attach (recommended) or Link to PDF file
Description:
I am using the pdf.js library to rendering PDFs that contain form fields with embedded formulas. When I open the PDF in any pdf reader and enter values, the formula in the specific field is triggered, and the result is calculated correctly for that field only.
However, when using pdf.js, entering a value in one field causes the formulas in all fields to be calculated, not just the one being edited.
In another pdf when I am entering any value it is suppose to do an calculation like this
but is not at all getting triggered
Expected Behavior:
Entering a value in a specific form field should trigger the formula and calculate the result for that field only.
I have been struggling with this issue for the past 2-3 days and would greatly appreciate any assistance or guidance. Thank you in advance for your help.
Web browser and its version
firefox 127.0
Operating system and its version
Linux
PDF.js version
pdfjs-dist: 3.11.174
Is the bug present in the latest PDF.js version?
Yes
Is a browser extension
No
Steps to reproduce the problem
Open any pdf which is having formulas in it.
What is the expected behavior?
Entering a value in a specific form field should trigger the formula and calculate the result for that field only.
What went wrong?
Either not triggering the calculation or triggering calculation for the filed which is not expected.
Link to a viewer
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: