We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Calculated fields don't update

Is there a support for PDF calculated fields in PDF library?

======================
I have a PDF template (with some text fields in PDF form) that I'm trying to populate from code.
It all works well - except for fields that are defined as 'calculated field' in PDF.

Let's say I have a PDF with text fields A & B, and B is defined as calculated field with value A*0.2
When I populate field A from code, save PDF and open it in Acrobat Reader, field B still shows 0.
When I edit field A in new PDF from Acrobat Reader, field B recalculates fine.

Attached is a sample of PDF file that I am using, with text fields - some plain and some calculated.
======================
Thanks.

Attachment: PdfWithCalculatedFields_c97820d9.zip

3 Replies

GR Gayathri Ramalingam Syncfusion Team May 18, 2017 04:29 PM UTC

Hi Slobodan, 
We did not use calculated field. We have used textbox filed and we have achieved the manipulation using JavaScript action. The JavaScript action has been handled by Adobe reader. So the textbox field has been updated automatically. If we need to manipulate the textbox field while creating the PDF document, we need to set the textbox value logically. We have prepared work around sample to achieve your requirement. 
Please find the sample from the following link, 
 
Please let us know if you need further assistance on this. 
 
With Regards, 
Gayathri R 



SB Slobodan Babic May 18, 2017 05:07 PM UTC

That's a nice workaround.
Since I'm in control of creating the PDF template in this case, it's easier for me to set all fields to be textual instead of calculated, and do the calculation in my code when filling the form.
But this workaround may be useful for someone else.
Thank you.


GR Gayathri Ramalingam Syncfusion Team May 19, 2017 05:35 AM UTC

Hi Slobodan, 
We are glad that the issue is resolved at your end and please let us know if you need further assistance. 
 
With Regards, 
Gayathri R 
  
 


Loader.
Up arrow icon