Issue with opening filled PDF in Adobe Reader

Hi,

I'm running into a problem when using the PDF API. Please refer to the attached project. When I run the project and click on the Download button, the controller opens a PDF file and sets the value in each form field, and returns the file as a File.

When the file downloads back, I open it in Chrome browser and can see the value set in all fields as shown in screenshot 1. However, when I open this document in Adobe Reader, all the fields show as blank as shown in screenshot 2. Can you please advise what may be causing this.

Thanks.

3 Replies 1 reply marked as answer

SD Saurabh D September 15, 2020 01:08 PM UTC

Attached files here.

Attachment: Screenshots_e59a9f32.zip


SD Saurabh D September 15, 2020 01:09 PM UTC

Project attached here.

Attachment: EJ2PdfViewer_(2)_1aab4ae0.zip


SL Sowmiya Loganathan Syncfusion Team September 16, 2020 12:51 PM UTC

Hi Saurabh,   
  
Thank you for contacting Syncfusion support.   
  
We have analyzed the reported issue and suspect that the issue may occurs due to disable of form fields appearance. Kindly use the below code snippet to overcome this issue since SetDefaultAppearance(false) will creates the appearance manually,   
  
//Load PDF document   
PdfLoadedDocument document = new PdfLoadedDocument(bytes);  
  
//Set default appearance   
document.Form.SetDefaultAppearance(false);  
  
foreach (var field in document.Form.Fields)  
{  
    if (field.GetType().Name.Equals("PdfLoadedTextBoxField", StringComparison.InvariantCultureIgnoreCase))  
    {  
        ((PdfLoadedTextBoxField)field).Text = "test";  
    }  
    if (field.GetType().Name.Equals("PdfLoadedCheckBoxField", StringComparison.InvariantCultureIgnoreCase))  
    {  
        ((PdfLoadedCheckBoxField)field).Checked = true;  
    }  
}  
  
  
Screenshot:   
  
  
Please try the above suggestion in your end and let us know the result.   
  
Regards,  
Sowmiya Loganathan  
 


Marked as answer
Loader.
Up arrow icon