0

I am using Itext in Java to create a PDF files. My requirement is as below:

A PDF file located at a particular location is password protected. I need to access the file and return the response from my webservice as a PDF in browser. We require that the user should not be able to use Save or Save As.. options from the Browser. I have tried the PDFWriter options like PDFWriter.ALLOW_COPY, but this does not diable the save as option.

Could anyone please guide me on how can we achieve the requirement.

Thanks, Mark

Mark Thomas
  • 101
  • 1
  • What if the user fetches the PDF with some other program like wget or curl? I don't think you can achieve total protection. – Henry Jan 28 '16 at 08:46
  • Hi Henry, Thanks for the response. That is a valid point, but for this use case we want to restict the user to download the PDF from the browser only when the response from the Webservice is visible to hm in the browser. – Mark Thomas Jan 28 '16 at 08:55
  • You are asking something that is impossibe. See my answer to the question [How to disable the save button and hide the menu bar in Adobe Reader?](http://itextpdf.com/question/how-disable-save-button-and-hide-menu-bar-adobe-reader) Every browser needs the bytes locally. You can not show a PDF in a browser without sending the bytes of that PDF to a local machine. – Bruno Lowagie Jan 28 '16 at 09:43

0 Answers0