Encrypt a PDF file using Aspose.PDF - What type of encryptions are supported

Hey,

I’m a Dev at a company that has the license to use Aspose.PDF 20.6. We had 2 questions regarding encryption. The way we handle things in code is mentioned as part of the question.

  1. What all encryptions and what kind of secure pdfs can Aspose handle to create package.
    a. We merge multiple documents using -
    i. Files to be merged are used as Apsose.PDF.Document.
    ii. Set Page order using Aspose.PDF.Page.tabOrder
    iii. Add to a single Document using document.Pages.Add(nextDoc.Pages)
    iv. Save using Document.Save
  2. Can Aspose encrypt already encrypted file? If so, what all can it handle? If not, would it result in an error?
    a. We use PDFFileSecurity.EncryptFile for encryption

Thanks for your assistance.

@gizmoghost95

We are gathering relevant details related to your inquiry and will share it soon with you.

@gizmoghost95

API does not allow to encrypt file multiple times because it needs to decrypt the file before this operation. It provides RC4/AES encryption methods with 40, 128, 256 key sizes.

For question #1, if I provide it an encrypted file, will it be able to handle that?
For example, I have 2 files, one encrypted and one that is not encrypted. Will it be able to merge those 2 via the process i have outlined?

@gizmoghost95

In such case, the recommended way is to decrypt the encrypted PDF file and then perform other operations. However, if you are facing some issue, please share some sample files along with the sample code snippet so that we can test the scenario in our environment and address it accordingly.