Export/Import form data

Hi!

I am working with the PDF viewer and am trying to save the PDF form data to a database, then retrieve and fill the PDF on document.load... I have tried using RetrieveFields and ExportFormFieldsAsObject for exporting, and UpdateFormFieldValue and ImportFormFields for importing, and can't seem to get a good match. ExportFormFieldsAsObject is giving weird unicode characters for the value of checkboxes, and UpdateFormFieldValue can't seem to handle radio buttons (or I'm doing it wrong). Is there a best practice for doing this? 

Thanks, 

Tony Elmquist


13 Replies

SK Shamini Kiruba Sobers Syncfusion Team March 21, 2022 03:32 PM UTC

Hi John, 
 
You can save the PDF form data using the exportFormFieldsAsObject() method and import using the importFormFields() method as in the below code snippet and the sample. 
 
Code snippet: 
 
<body class="bootstrap5"> 
<button onclick="exportFormFieldsAsObject()"> 
Export form fields as object 
</button> 
<button onclick="importFormFieldsFromExportedObject()"> 
Import form fields from exported object 
</button> 
    <div id='sample'> 
    <script> 
    var exportdata; 
    function exportFormFieldsAsObject(){ 
        var viewer = document.getElementById('container').ej2_instances[0]; 
        viewer.isSignatureEditable = true; 
        viewer.exportFormFieldsAsObject().then(function (value) { 
            exportdata = value; 
            console.log(exportdata); 
        }); 
 
    } 
    function importFormFieldsFromExportedObject(){ 
        var viewer = document.getElementById('container').ej2_instances[0]; 
        viewer.importFormFields(exportdata); 
    } 
    </script> 
</body> 
 
 
 
Regards, 
Shamini 



JA John Anton March 21, 2022 09:16 PM UTC

The checkboxes and radio buttons don't work in that sample - and that's most of what I have to handle :P



SK Shamini Kiruba Sobers Syncfusion Team March 22, 2022 07:05 AM UTC

Hi John, 

We were able to reproduce the issue “Checkbox, radio button, and signature data are not getting imported on importing the form fields” and validating it. We will provide further details on March 24, 2022

Regards, 
Shamini 



SK Shamini Kiruba Sobers Syncfusion Team March 25, 2022 03:53 AM UTC

Hi John, 

We are still analyzing to find the root cause of the issue. We will update further details on or before March 29, 2022

Regards, 
Shamini 



SK Shamini Kiruba Sobers Syncfusion Team April 5, 2022 04:07 AM UTC

Hi John,


We have validated and logged the defect report as “The checkboxes and radio buttons on the form fields are not imported correctly with the exported data”. The fix for the issue will be available in our upcoming weekly NuGet release on April 27, 2022.


There is a technical glitch in generating the feedback report and will update the link ASAP, once the glitch is resolved.


Regards,

Shamini



SK Shamini Kiruba Sobers Syncfusion Team April 5, 2022 12:51 PM UTC

Hi John,


We have generated the feedback report. You can track the status of the issue through the following link.


Feedback: https://www.syncfusion.com/feedback/33935/the-checkboxes-and-radio-buttons-on-the-form-fields-are-not-imported-correctly


Regards,

Shamini



SK Shamini Kiruba Sobers Syncfusion Team April 28, 2022 04:35 AM UTC

Hi John,


Sorry for the inconvenience. The fix was not included in our latest weekly NuGet release. However, we will include the fix in our upcoming weekly NuGet release without further delay on May 11, 2022.


Regards,

Shamini



SK Shamini Kiruba Sobers Syncfusion Team May 12, 2022 01:37 PM UTC

Hi John,


Sorry for the inconvenience. The fix was not included in our latest release. However, we will include the fix in our upcoming weekly NuGet release without further delay on May 25, 2022.


Regards,

Shamini



SK Shamini Kiruba Sobers Syncfusion Team May 25, 2022 05:49 PM UTC

Hi John,


Sorry for the inconvenience. The fix was not included in our latest weekly NuGet release. However, we will include the fix in our upcoming weekly NuGet release without further delay on June 1, 2022.


Regards,

Shamini



SK Shamini Kiruba Sobers Syncfusion Team June 3, 2022 05:06 AM UTC

Hi John,


Sorry for the inconvenience. The fix was not included in our latest weekly NuGet release. However, we will include the fix in our upcoming weekly NuGet release without further delay on June 8, 2022.


Regards,

Shamini



SK Shamini Kiruba Sobers Syncfusion Team June 9, 2022 03:30 AM UTC

Hi John,


Sorry for the inconvenience. The fix was not included in our latest weekly NuGet release. However, we will include the fix in our upcoming weekly NuGet release without further delay on June 15, 2022.


Regards,

Shamini



SK Shamini Kiruba Sobers Syncfusion Team June 16, 2022 04:49 AM UTC

Hi John,


Sorry for the inconvenience. The fix was not included in our latest weekly NuGet release. However, we will include the fix in our upcoming weekly NuGet release without further delay on June 22, 2022.


Regards,

Shamini



VV Visvesvar Venkatesan Syncfusion Team June 24, 2022 01:23 PM UTC

Hi John,


We have fixed the reported issue “The checkboxes and radio buttons on the form fields are not imported correctly with the exported data” and the fix for the reported issue was included in our latest weekly release v20.1.0.61. Kindly upgrade to that version to get the issue resolved.

   

Packages:   


Service side package

ASP.NET Core :      

https://www.nuget.org/packages/Syncfusion.EJ2.PdfViewer.AspNet.Core.Windows/ 
https://www.nuget.org/packages/Syncfusion.EJ2.PdfViewer.AspNet.Core.Linux/       

https://www.nuget.org/packages/Syncfusion.EJ2.PdfViewer.AspNet.Core.OSX/      

       

ASP.NET MVC:      

https://www.nuget.org/packages/Syncfusion.EJ2.PdfViewer.AspNet.Mvc5/      

https://www.nuget.org/packages/Syncfusion.EJ2.PdfViewer.AspNet.Mvc4/


   

CDN Links:

https://cdn.syncfusion.com/ej2/20.1.61/dist/ej2.min.js

https://cdn.syncfusion.com/ej2/20.1.61/material.css



Regards,

Visvesvar k v


Loader.
Up arrow icon