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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Need to make a fillable pdf form web-viewable

Thread ID:

Created:

Updated:

Platform:

Replies:

150650 Jan 14,2020 06:08 PM UTC Jan 16,2020 10:18 PM UTC ASP.NET Core - EJ 2 3
loading
Tags: PDF
Amy H
Asked On January 14, 2020 06:36 PM UTC

Hi,

I have this pdf form (that comes in a portfolio of pdf's) looking for a library solution that will work for what I need. It's easy enough to split the portfolio into pdfs. The problem is one of the forms is a fillable form that when opened in a browser shows as one page with the message "Please wait...   If this message is not eventually replaced by the proper contents of the document, your PDF viewer may not be able to display this type of document.  ". If I open it up in adobe I can see it's a 3 page form with radio buttons, dropdowns, and text fields all filled in. I can go print to pdf, which then removes all the fillable/editable properties and the filled in form is now viewable in a browser. I want to be able to do that in my application.... 

I did look through the forums an on a forum for Xamarian.forms I found a snippet of code to test if the pdf is a XFADocument, (https://www.syncfusion.com/forums/130671/fill-pdf-and-flatten-option) that does return a count greater then 0. But when I open up the form in adobe after downloading it all the fields are blank. And even if it is a XFA document I can't figure out how to flatten it so it will be viewable like normal pdfs in a browser (and ofcourse without clearing the data in the form). 

Additional details :
Using nuget Syncfusion.Pdf.Net.Core library
This is a web application so I'm getting the portfolio pdf as an IForm file input (and I am converting the split pdf's back into a memory stream --> to an array of IForm file's to pass to another class). 


I should add I tried the Syncfusion.Pdf.AspNet package as well to try this bit of code 
//Load the existing document

PdfLoadedXfaDocument ldoc = new PdfLoadedXfaDocument("input.pdf");

//Set flatten

ldoc.Flatten = true;

//Save the document

ldoc.Save("output.pdf");

//Close the document

ldoc.Close();

BUT... I get the following error
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
System.TypeInitializationException: The type initializer for 'Syncfusion.Pdf.Graphics.PdfTrueTypeFont' threw an exception. ---> System.NotSupportedException: No data is available for encoding 1252. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.

Gowthamraj Kumar [Syncfusion]
Replied On January 15, 2020 01:07 PM UTC

Hi Amy, 

Thank you for using Syncfusion product. 

We have tried to reproduce the reported issue in our end. We suspect that the issue may occurs with the specific document. So, kindly share us the input document, complete code snippet, simple sample to reproduce the issue in our end. So that it will be helpful for us to analyze and assist you further on this. 

Regards, 
Gowthamraj K 


Amy H
Replied On January 16, 2020 05:33 PM UTC

Is there a help email I can send the document to? I don't want to post it on an open forum?


Davis Jebaraj [Syncfusion]
Replied On January 16, 2020 10:18 PM UTC

Hi Amy,
Please email the document support at syncfusion.com

Thanks,

Davis

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon