Aspose.Pdf.Facades.PdfFileSecurity _sec = new Aspose.Pdf.Facades.PdfFileSecurity(“D:\PoCPDF.pdf”, “D:\PoCPDFPassword.pdf”);
_sec.EncryptFile(“abc1234”, “abc1234”, _previ, Aspose.Pdf.Facades.KeySize.x256);
Just a quick observation regarding this topic…
I am currently doing this with Aspose.PDF 19.11 - in this case we set both userpassword and ownerpassword to the same value and we don’t seem to be experiencing the issue described by mubst. The document prompts for a password every time the user tries to open it. Can I therefore make the assumption that this got fixed at some point between the “build 17” version that mubst was using and the current build 19.11?
We are afraid it was not logged in our issue management system because we were able to sort it out as per the response above. So any changes were not made in the API for this thread. However, it is also possible that some changes while working on some other problem might have affected the scenario somehow.