Reputation: 21
I am doing an web application using itext in java environment.
The main issue here is I need to "disable" the print button. Here is the general flow:
1) User downloads PDF using IE 2) User selects to print PDF. 3) Disable PDF print button after PDF is printed.
Is it possible to do it?
I have explored adding security feature to print function but what i want is to disable the print button after user printed the pdf once.
Or is it possible to use javascript to "intercept" the print function by pop-up message and stop the pdf from being printed.
Thanks.
Upvotes: 0
Views: 387
Reputation: 77528
No, that's not possible. You can disable printing using encryption, but it's an all-or-nothing deal. You can's say: disable printing more than once (even if you could: a customer could save the same PDF more than once, and print every copy).
You need a DRM solution to achieve what you want (and iText doesn't offer DRM services). Those services are usually very expensive. The document needs to connect to a server to check if the document has already been printed before printing is allowed.
Upvotes: 1
Reputation: 975
You mean you want that the document can be printed exactly once? Forget it.
It should be possible if you use JavaScript (there was a German company "DHL" which used this a time ago) but think about it: you need the "help" from the user (the user has to use a JavaScript enabled Pdf-Reader which has not to be the case), nearly every user is capable of circumventing this security feature (f.e. patching iText to ignore every security feature is a one-liner, I know because I did...) and what happens if the printing on user side goes wrong?
The German company which I mentioned before, recognized that their idea of protecting the user from printing a document more than once was crap and they removed the lock (these were barcode tagged post stamps).
Upvotes: 1