We are taking a few existing .pdf files and combining them into 1 using the following code:
public void combinePDF(string input1, string input2, string output) { Aspose.Pdf.License imageListLicence = new Aspose.Pdf.License(); imageListLicence.SetLicense("Aspose.Total.lic"); //open first document Document pdfDocument1 = new Document(input1); //open second document Document pdfDocument2 = new Document(input2);<SPAN style="COLOR: green">//add pages of second document to the first</SPAN> pdfDocument1.Pages.Add(pdfDocument2.Pages); <SPAN style="COLOR: green">//save concatenated output file</SPAN> pdfDocument1.Save(output); }</PRE>
At the end of the process, we then encrypt the file:
public void encryptPDF(string fileName, string newFileName, string userPassword, string ownerPassword) { Aspose.Pdf.License imageListLicence = new Aspose.Pdf.License(); imageListLicence.SetLicense("Aspose.Total.lic"); //open PDF document PdfFileSecurity fileSecurity = new PdfFileSecurity(fileName, newFileName); //change password fileSecurity.EncryptFile(userPassword, ownerPassword, DocumentPrivilege.Print, KeySize.x256); ; }The issue is, there are many Acrobat Reader machines that are having issues decrypting the .pdf file at the end. Acrobat Pro seems to be ok, but the free versions are receiving either errors that Adobe can not decrypt the file, or the program just errors out.
Anyone seen this before? Was wondering if it had to do with the KeySize.x256, but if we create a .pdf from scratch with multiple images, they can open the file ok.
Thanks in advance for your help.