wojtekmaj / react-pdf

Display PDFs in your React app as easily as if they were images.
https://projects.wojtekmaj.pl/react-pdf
MIT License
9.56k stars 897 forks source link

Support PDF Form Field Calculations is missing #1851

Open paritosh-mahale opened 3 months ago

paritosh-mahale commented 3 months ago

Before you start - checklist

Description

There is a functionality available in pdf.js that allows for automatic calculations within PDF form fields if formulas are set. When a PDF form field changes value, the calculations are triggered, and the results are automatically updated in the respective form fields. However, this feature is not currently available in react-pdf.

This is screenshot from pdf.js where on selecting of QTY from dropdown is automatically calculates total by multiplying price per * QTY also the grand total get calculated automatically. image

this functionality is not working in react-pdf image

Adding document for ref calculation-issue (2).pdf

pdf.js team also fixed wrong calculation issue recently please consider that to which fixing this

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.

Steps to reproduce

  1. Load attached PDF using react-pdf.
  2. Change QTY from dropdown and observe that the calculations are not triggered.

Expected behavior

When a form field is changed in a PDF loaded by react-pdf, the calculations set within the PDF should be triggered, and the result should be reflected in the respective form fields.

Actual behavior

The calculations set within the PDF are not getting trigger.

Additional information

No response

Environment

rahulrajpal2911 commented 3 months ago

I am facing the same issue. Did you get any support, @paritosh-mahale?

shivanijaiswal610 commented 3 months ago

Hi @paritosh-mahale, I’m facing a similar issue. Were you able to find any solutions or receive any assistance?

wojtekmaj commented 3 months ago

Forms rendered by React-PDF are at the moment read-only.

rahulrajpal2911 commented 3 months ago

Hi @wojtekmaj Is there any expected time to enhance this? I have used this library in my React module, and now it has become a blocker. Therefore, it would be helpful if you could reply to my message.

paritosh-mahale commented 2 months ago

Hi @wojtekmaj Do you have any updates for me on this?

paritosh-mahale commented 2 months ago

Hi @wojtekmaj Is this something that will be implemented in the near future?