We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Unable to lock pdf from copy and print

Hello Aspose Team,
I was trying to lock a pdf file from copying and printing using the link from your documentation.
How ever I was able to lock a user from doing so in adobe pdf and Google chrome. But, if I open the same file in firefox I was able to copy as well as print the pdf document.

Code I used is as follows
DocumentPrivilege privilege = DocumentPrivilege.ForbidAll;
privilege.ChangeAllowLevel = 1;
privilege.AllowPrint = false;
privilege.AllowCopy = false;

PdfFileSecurity fileSecurity = new PdfFileSecurity(textBox1.Text,
Environment.CurrentDirectory + @"\output.pdf");

fileSecurity.SetPrivilege(privilege);


Hi Rakesh,

We are sorry for the inconvenience caused. While testing the scenario with the latest version of Aspose.Pdf for .NET 9.2.0, we have managed to reproduce the reported issue and logged it in our bug tracking system as PDFNEWNET-36934 for further investigation and resolution. We will notify you via this thread as soon as it is resolved.

Please feel free to contact us for any further assistance.

Best Regards,

Hi Rakesh,


Please note we have investigated the issue and found it is FirFox browser specific issue. It is a bug of pdf.js (pdf viewer for FireFox), please take a look here https://bugzilla.mozilla.org/show_bug.cgi?id=792816 . It completely ignores document restrictions. We recommend to use Adobe Acrobat plugin as default PDF viewer in FireFox as following. Hopefully it will resolve the issue.

  • At the top of the Firefox window, click on the Firefox button and then select Options
  • Select the Applications panel
  • Find Portable Document Format (PDF) in the list and click on it to select it
  • Click on the drop-down arrow in the Action column for the above entry and select Use Acrobat Reader (in Firefox)
  • Restart the browser

Please feel free to contact us for any further assistance.

Best Regards,