Hi,
I got System.ApplicationException:You cannot change this document because it is certified.
when I try to encrypt a pdf file.
Tested OSs were Win7 and Win10
.NET target platform is .net 6.0
Using SDK: Aspose.PDF for .Net 24.3
Using code:
void testEncrypt(string filename)
{
// Open document
Document document = new Document(filename);
// Encrypt PDF
document.Encrypt("user", "owner", 0, CryptoAlgorithm.RC4x128);
// Save updated PDF
document.Save(filename + "Encrypt_out.pdf");
}
Exception detail
System.ApplicationException
HResult=0x80131600
Message=You cannot change this document because it is certified.
Source=Aspose.PDF
StackTrace:
在 #=z$altj3IjuYPTOtBPSUzr2p0AuT3y.#=zGS45a0g=(String #=zwH190Y8KjNOy, String #=zA8D331S0NrIV, #=z_Tj8br1bfduoZ8ywhxbyeqaW2T2b #=zxV1enwk=, CryptoAlgorithm #=zDfd2CpjWwtR_, Boolean #=zzxGA3V86P4sA)
在 Aspose.Pdf.Document.Encrypt(String userPassword, String ownerPassword, Permissions permissions, CryptoAlgorithm cryptoAlgorithm, Boolean usePdf20)
在 Aspose.Pdf.Document.Encrypt(String userPassword, String ownerPassword, Permissions permissions, CryptoAlgorithm cryptoAlgorithm)
在 Program.<<Main>$>g__testEncrypt|0_3(String filename) 在 C:\.NET\ConsoleApp1\ConsoleApp1\Program.cs 中: 第 52 行
在 Program.<Main>$(String[] args) 在 C:\.NET\ConsoleApp1\ConsoleApp1\Program.cs 中: 第 57 行
Using file:
黄石亿嘉镀铝膜 卤素 中文版(1).7z (474.3 KB)