Error: Unknown encryption type. Please help!

Hello,
I’m currently evaluating the Pdf.Form product and running into some problems.

When I try using Pdf.Form I receive the following error:


System.IO.IOException: Unknown encryption type: 4



I am trying to read in Pdf form data from the Request.InputStream, and save it to a new, flattened Pdf.

My code looks like this:

Form form = new Form(stream, outFile);
string mPath = System.Configuration.ConfigurationSettings.AppSettings[“Path”];string mOutputPdf = “aNewFile.pdf”;
form.FlattenAllFields(); form.Save();


I have a template Pdf available, but I’m not sure where to add this either.
The exception is thrown at the Form contstructor line.
What type of input does the Form expect when using a Stream; XML, FDF, XDP, or QueryString values, etc.?

I’m in a terrible hurry to get this working, so your help is greatly appreciated!
thanks

Dear brent,

Thanks for considering Aspose.Pdf.Form.

1) About the first problem "Unknown encryption ", could you attach input pdf?

2)About the second problem, in the following code, you should set the value of the parameter “outFile” before the constructor, not after that.
Form form = new Form(stream, outFile);

3)A simple and better example is introduced in this post https://forum.aspose.com/t/135849, which is including the input pdf and complete code. Please refer to it.

Best regards.

FYI.

Just attach your file in this thread since it can be seen by Aspose people only. Any other customers or visitors can not see your file.

Thanks for your reply. I’ve inlcuded 2 files: one was saved to export the form data as Xml on submit, from Acrobat 7. The other, ‘EmploymentApplicationForm3.pdf’, was saved from Acrobat 6 and exports Fdf data.

I’ve also tried loading a System.Data.DataTable into the AutoFiller and I get the same error. The DataTable was filled from and Xml file, and the Xml was generated from the Pdf.

Also, thanks for the wiki link. I’m just having trouble loading from an input stream. Are there any examples of using an input stream, particularly Xml, and using that xml to fill a template pdf file, and then finally saving the new pdf?

Thanks again for your help!

Dear brent,

1)In current version of Aspose.Pdf.Form, import/export xml is not supported now. It will be supported in next version. Import/export fdf has been added in the latest version. Please download it from Aspose.PDF Downloads.

2)AutoFiller can only support to pdf stream. Both input and output are pdf stream or files.

3)About the exception of “Encryption type”, our product now has not supported the latest Encryption alogrithm of version 4. We will think to support it in next version.

Best regards.

Thanks again. I’m now trying to discard the xml and use only a Pdf stream. I’ve setup the form pdf to submit ‘entire pdf’ to a url. It appears that Pdf doesn’t allow sending form data this way, becuase when the user clicks submit, the pdf throws an ‘Operation not allowed’ error, and fails to submit.

Could you please provide any other information on how to send a Pdf stream containing user data? Is there some piece I’m missing here?

If this is not possible; then how, using your product, can an Acrobat 7.0 Pdf be setup to submit live form data to a script, and that script be able to save the data to a new, flattened pdf? I’m open to any suggetions!

Thanks so much for your help!
Brent

Dear brent,

You are welcome.

I guess your application case is like this: The users click the “submit” button, and you want to save all the data what he fills in. Is this right?

1) Just as the picture in the attachment, I also haven’t found a way to created a pdf through setting the action of “submit” button after I try a lot. About this you could read the help doc or ask the Adobe.

2) After you create a pdf or fdf, then you could extract the fields’ value through reading the pdf using Aspose.Pdf.Form.

Best regards.