File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Languages and the fly likes Disable Shortcut Keys in PDF for Print/Copy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Other Languages
Bookmark "Disable Shortcut Keys in PDF for Print/Copy" Watch "Disable Shortcut Keys in PDF for Print/Copy" New topic

Disable Shortcut Keys in PDF for Print/Copy

Rohit Kedia
Ranch Hand

Joined: Apr 24, 2010
Posts: 79

Hi ,

I am working on a PDF which is stored in Oracle Database in BLOB column.
When I am retreiveing the Data as a Byte Array from Database I am converting the Byte Array to Byte Array OutPut Stream and Flushing it to show a PDF in a New Window.

Now I want to add restrictions to the PDF that it cannot be Printed/Copied/Save to a Desktop, I was able to hide the Toolbars from the PDF but the Short-Cut Keys are still working.
Please suggest what can I do to stop this, I am working in Java 1.4.

Apology if it is not posted in the Correct Forum.
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

A question about working with a PDF document... no, your suspicion is correct, that's nothing to do with servlets. Let's find a better home for it.
Sarah Wang

Joined: Dec 23, 2010
Posts: 2
I have completely the same question like yours, but I still couldn't find a way to resolve it. Here is the related artice link I searched in this site for your reference - it generates a encrypted pdf in the local drive and it works! But in my case, I have to make the pdf output in a popup browser instead of a real pdf in the local drive. When I applied to my code, what I got was an empty page. You can try that and maybe you can figure it out. And if you do, please share with me. Thanks.

the related artice link

the API and Jar you will need as follows.
API of iText (javadoc format):


sample code
I agree. Here's the link:
subject: Disable Shortcut Keys in PDF for Print/Copy
It's not a secret anymore!