Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Sample:
PdfFileSecurity sec = new PdfFileSecurity(stampedStream, securedStream);
documentPrivilege.AllowScreenReaders = true;
DocumentPrivilege documentPrivilege = DocumentPrivilege.ForbidAll; documentPrivilege.AllowPrint = true;
sec.EncryptFile(null, null, documentPrivilege, KeySize.x128);
We receive exception:
Aspose.Pdf.Exceptions.InvalidPasswordException was caught
Message=User password can't be same as owner password
Source=Aspose.Pdf
StackTrace:
at Aspose.Pdf.Facades.PdfFileSecurity.[1](String , String , String , Permissions , CryptoAlgorithm )