Disable save option in PDF
807588Mar 18 2009 — edited Mar 18 2009I am able to create a PDF file using com.lowagie.text API. But I want to disable the save option at download of PDF. i just want to give the facility of opening the PDF. User should not be able to save the PDf even after opening it.
//Create PDF Document
OutputStream os
docWriter = PdfWriter.getInstance(document, os);
document.open();
document.add(table); // table contains all the data which needs to be displayed on PDF
After creating the PDf , I am writing PDF to Servlet Output Stream
I also found somewhere this code to disable the save button
PdfReader reader = new PdfReader(fileName);
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(fileName));
stamper.setEncryption("my-owner-password".getBytes(), "my-user-password".getBytes(),
PdfWriter.AllowPrinting | PdfWriter.AllowCopy, PdfWriter.STRENGTH40BITS);
stamper.close();
But I am not able to solve my problem with this code
Please help!!! thanks