Hello,
I wrote a servlet to serve PDF using iText. Is there any way to disable printing/Copying/Saving from the browser end?
Hello,
I wrote a servlet to serve PDF using iText. Is there any way to disable printing/Copying/Saving from the browser end?
Here's a thread that provides the relevant magic API invocation. The idea is that you have to encrypt the PDF in order to protect various user operations.
PdfReader reader = new PdfReader("my-old-file.pdf");
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream("my-new-file.pdf"));
stamper.setEncryption("my-owner-password".getBytes(), "my-user-password".getBytes(),
PdfWriter.AllowPrinting | PdfWriter.AllowCopy, PdfWriter.STRENGTH40BITS);
stamper.close();