Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Password Protection is NOT Working When Opening PDF in Mobile

$
0
0
Hi,

I have applied password protection for PDF file using Aspose.PDF V8.2.0.0. The password protection is working fine in my PC but when I open the same PDF using any mobile, the PDF file is not prompting for user password. See below code snippet which I used to apply password protection.

Aspose.Pdf.Facades.PdfFileSecurity PDFFileSecurity = new PdfFileSecurity(tempstrFullFilePath, strFullFilePath);
       DocumentPrivilege documentPrivilege = DocumentPrivilege.ForbidAll;
       // Only allow screen reading
       documentPrivilege.AllowModifyContents = true;
       documentPrivilege.AllowPrint = true;
       documentPrivilege.AllowModifyAnnotations = true;                            
       PDFFileSecurity.EncryptFile("password", "", documentPrivilege, KeySize.x128, Algorithm.RC4);

Please let me know if I am missing anything to include.

I have attached the sample PDF and the password is "pwcwelcome1"

Regards,
Vijay

Viewing all articles
Browse latest Browse all 3131

Trending Articles