Fill in pdf forms in server side or javascript pdfviewver ej1

Hi
I'm trying to fill in the fields of an already loaded pdf. I found this example but it uses the download.
https://www.syncfusion.com/forums/82246/best-practice-automated-populating-of-pdf-forms

I want to fill in the fields and make them visible in the pdf viewver.
It should fill in the fields at the push of a button and not during the load

how can I do?
thank you



5 Replies 1 reply marked as answer

VS Vasugi Sivajothi Syncfusion Team March 3, 2021 07:38 AM UTC

Hi Giovanni, 
 
Greetings from Syncfusion support,   
 
We can add the values in form fields from code behind using the updateFormFieldsValue method, please refer to the below sample and code snippet, 
 
Code Snippet: 
 
 
<button id="id">Add Values</button> 
document.getElementById("id").addEventListener("click", function() { 
var formField = viewer.retrieveFormFields(); 
  formField[0].value = "vasugi"; 
  viewer.updateFormFieldsValue(formField[0]); 
}); 
 
To Update the signatures from code behind:  
 
Draw: 
 
var formField = viewer.retrieveFormFields(); 
formField[8]. signatureType = [SignatureType.Draw]; 
formField[8].value = ""; 
viewer.updateFormFieldsValue(formField[8]); 
 
Type: 
 
var formField = viewer.retrieveFormFields(); 
formField[8].signatureType =[SignatureType.Type];             
formField[8].value = "name"; 
formField[8].fontName = "Symbol"; 
viewer.updateFormFieldsValue(formField[8]); 
 
Image: 
 
var formField = viewer.retrieveFormFields(); 
formField[8].signatureType=[SignatureType.Image];            
formField[8].value = ""; 
viewer.updateFormFieldsValue(formField[8]); 
 
 
 
 
 
Please refer to the below documentation to fill the form fields in the server side, 
 
 
 
Please let us know if you have any concerns about this, 
 
Regards, 
Vasugi 



GI Giovanni March 3, 2021 06:22 PM UTC

Excuse me but I wanted to know how to do with ej1.

Thanks


VS Vasugi Sivajothi Syncfusion Team March 4, 2021 10:06 AM UTC

Hi Giovanni, 
 
 
Currently, we do not have support to add the values in form fields from the code behind in EJ1. However, we will analyze further on this and update you with more details on March 8, 2021. 
 
 
Regards, 
Vasugi 



GI Giovanni March 4, 2021 03:48 PM UTC

Thank you so much you are fantastic!


VS Vasugi Sivajothi Syncfusion Team March 9, 2021 08:47 AM UTC

Hi Giovanni, 
  
  
Thanks for the update. 
  
  
As we mentioned earlier, we do not have support to add the values in form fields from the code behind in EJ1. We will not have a plan to implement this feature, we will fix only the bugs in our EJ1 control. So, we request you to upgrade the EJ2 component to add the values in form fields from the code behind in the pdf viewer. Kindly refer the documentation and online demo from the below link 
  
  
  
  
  
  
Please let us know if you have any concerns about this. 
  
  
Regards, 
Vasugi

Marked as answer
Loader.
Up arrow icon