stephanrauh / ngx-extended-pdf-viewer

A full-blown PDF viewer for Angular 16, 17, and beyond
https://pdfviewer.net
Apache License 2.0
472 stars 180 forks source link

Form Field Calculation Triggering Unexpectedly in ngx-extended-pdf-viewer #2474

Open paritosh-mahale opened 1 month ago

paritosh-mahale commented 1 month ago

Description:

I am using the ngx-extended-pdf-viewer library to render PDFs that contain form fields with embedded formulas. When I open the PDF in Chrome and enter values, the formula in the specific field is triggered, and the result is calculated correctly for that field only.

However, when using ngx-extended-pdf-viewer, entering a value in one field causes the formulas in all fields to be recalculated, not just the one being edited.

image (4)

In the image you can see that no quantity has been selected still Ext Cost is getting calculated by assuming quantity as 1 which is impacting total cost

Expected Behavior: Entering a value in a specific form field should trigger the formula and calculate the result for that field only, similar to how it behaves in Chrome.

Actual Behavior: Entering a value in any form field triggers the formulas in all fields, recalculating all results.

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.

stephanrauh commented 1 month ago

Which version of the viewer are you using? I'm asking because I only support the latest one - that's version 21, which is due to be released soon.

I assume this is a bug of the base library (pdf.js), so please check

If this turns out to be a pdf.js bug, please open a bug report at https://github.com/mozilla/pdf.js/issues. Note that it's important to point out that it's a Firefox bug - otherwise the pdf.js team often closes the ticket because they consider it out of their scope.