Cete won't open pdf when the correct password is used.

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v6)  /  Cete won't open pdf when the correct password is used.

DynamicPDF CoreSuite for .NET (v6) Forum


I have a set of pdfs. They are all secured by a password. Cete opens some of them when the password is given, but throws an:

Document can not be decrypted. Unrecognized algorithm.

error for others. This happens when executing the following line:

PdfDocument pdf = new PdfDocument(contents, password);

In all of these cases, I can open the same pdf in Adobe Acrobat Pro, provide the same password I used in my code and I can remove the security.

Does anyone have any thoughts as to what could be causing something like this?
Posted by a ceTe Software moderator
Hello,

Currently Merger will be able to decrypt the documents if they are encrypted using one of the following settings.

Acrobat 3 and later – 40-bit RC4
Acrobat 5 and later – 128-bit RC4

You can check this setting if you open the security tab in Adobe Acrobat Pro X, click on “Change Settings” -> “Compatibility” dropdown box. If your PDF has an encryption setting other than the two listed above the Merger will not be able to decrypt it.

Thanks,
ceTe Software Support Team.

So does that mean 128-bit AES encrypted pdf's cannot be opened by Dynamic PDF Merger? I'm actually using Adobe Acrobat 9.4 Pro.
Posted by a ceTe Software moderator
Hello,

That is correct, 128-bit AES encrypted PDFs cannot be opened with Merger.

Thanks,
ceTe Software Support Team.
What about a PDF with these security details?

Security Method: Password Security
Document Open Password: No
Permissions Password: Yes
Changing the Document: Not Allowed
Commenting: Not Allowed
Form Field Fill-in or Signing: Not Allowed
Document Assembly: Not Allowed
Content Copying: Not Allowed
Content Accessibility Enabled: Not Allowed
Page Extraction: Not Allowed
Encryption Level: 128-it RC4

I'm guessing that "Document Assembly" or "Content Copying" being disallowed would still block DynamicPDF from opening it without a password?
Posted by a ceTe Software moderator
Hello,
 
Based on the security details you have posted, yes you would need the password to open the PDF using DynamicPDF.

Thanks,
ceTe Software Support Team. 
OK, that makes sense now.  I'm already working to absorb this change for my application.

FWIW, I couldn't find anything in the help about the max length for a password, not that a password can't be null.  May I suggest making that information available (even if linked to) in the help?
Posted by a ceTe Software moderator
Hello,

The password can be up to 32 characters in length. Thanks for the feedback we will consider adding this information to our documentation.

Thanks,
ceTe Software Support Team.   
Is there any updates for this? Can Merger now open PDFs with 128/256 bit encryption? If so, could you provide sample code? I am not having any luck and need to remove a password from a PDF.
Posted by a ceTe Software moderator
Hello,

Version 6 support RC4 128 bit encryption, but not AES 128/256. That support came in v7. With that version or later, you will need to specify the correct owner password for merging these kind of PDFs. You can refer to the documentation on security here.

Also here is a code sample to merge secured PDFs.

      PdfDocument pdf=new PdfDocument(@"Secured PDF file path", "Correct owner password");
      MergeDocument document=new MergeDocument (pdf);
      document.Draw(@"output PDF file path");

You can download latest DynamicPDF Merger for .NET product from Nuget (product ID: ceTe.Dynamicpdf.com.CoreSuite.NET) or from our website here.

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 9:04 AM.