Topic: Do not download my pdf !

Hello there,

I have a customer requeriment but i think it's impossible to do:

She wants the user to view or print a pdf but not to download it. Every time a user need to print or view a document, it should be online.

Note: It's not a requeriment to work with pdf. I can propose her other way to print information so the user can't download it.

Any suggestions, please?

Re: Do not download my pdf !

Hmm...there is no way to prevent the user from downloading the file. In fact, by "viewing" it, it is in fact being downloaded to a temporary, cached area. I'm not sure if PDF security measures exist to make it difficult (or impossible) to view on a client machine...I'm not really familiar with the format itself.

Re: Do not download my pdf !

A customer of mine recently tried to implement a similar measure with the display of time-sensitive health related information. The goal was to only ever view it online so it was always up to date. If someone printed a hardcopy it will likely be wrong later in the day.

If the user can view it, then they can take the data with them. Thats all there is to it.

We decided that if our customers users can be trusted to view the sensitive data, then they can be trusted to follow directions and not print it or save it. If your users can't be trusted to do that then you either need to show them less sensitive information, train them, or do something else outside of the software.

Re: Do not download my pdf !

You're not going to be able to prevent it from being downloaded if the person really wants to download it. The only thing I can think of is some sort of e-book DRM software... which would then prevent the files from being opened.

Re: Do not download my pdf !

as manitoba pointed out, "viewing" means downloading to the temp directory of your machine and displaying it in thr browser. so if someone really wanted to save it, he would only have to look inside his temp directory and copy it somehwere else.

So my vote is for "not possible".

Re: Do not download my pdf !

First of all, the user can always "print to file" :) So, leaving the printing option available indirectly leaves the save option open - there is really no solution to this.

The only thing I can offer is that you don't send the data as a pdf, but instead send it as an image.  You can generate the pdf on the backend and then convert it to an image.  In linux, this is usually accomplished simply with the following:

convert file.pdf file.jpg
convert file.pdf file.png
#etc ..

The image can then be presented like any other image and printed just as such.  But now the user does not have access to the pdf.

Just a thought, may or may not help.

Re: Do not download my pdf !

If the goal is to prevent leaks, watermarking is also a very good option.

I don't recall which publisher does it, but when you buy a rails book as a PDF it says "Made for Your Name" at the bottom of each page. So if you show PDFs to your user and it says "Generated for username on date" you would know who "lost" it and you can actually do something about it.

You can also add a watermark to the document that says "Do Not Print, Save, or Copy".

What is your customers motivation for not allowing people to print? Is it time-sensitive data (i.e. print it out now and the data is not current)? Is it an internal document that should only be seen by some employees (i.e. a salary list)?

As I said earlier, if you can't trust the users not to print, can you really trust them to see the information at all?

Re: Do not download my pdf !

37Signals does that with "Getting Real" smile

You might be able to do some sort of Flash preview that can be printed but would be harder to download and ditch PDF altogether... maybe.  Might not be worth the effort though (probably not).

Josh Catone helps run this place
Rails Forum - Rails Jobs

Re: Do not download my pdf !

Thank you all for your interest and opinions.

I think i will try to do this:

1) Try to convince my customer to allow people to download the documents.
2) Research Adobe Acrobat Writer to see if i can disable the save as button (we all know the document is already downloaded in temp but lot of people don't know this)
3) Try to convince my customer to allow people to download the documents.
4) Try to convince my customer to allow people to download the documents, again.
5) Develop one java applet or flash movie per document showing a button in the browser to directly print data to the printer.
6) Take vacations.


Re: Do not download my pdf !

Step 6 is the most important. wink Good luck.

Josh Catone helps run this place
Rails Forum - Rails Jobs

Re: Do not download my pdf !

I love the plan. Let us know how it works out!

Re: Do not download my pdf !

There is one more option.  big_smile

Hack things around to make it slightly more difficult to do "save as".

You can disable the right-click menu with some javascript. And you can do some funky simple things with CSS and iframes, so the browser displays the pdf -- but the browser is too confused to let the user save it elsewhere.

It's not full-proof of course, but this kind of obfuscation should work for most non-technical users. That's what google and amazon do for their ebooks to some degree.

Mark Pilgrim in his book "Greasemonkey Hacks" explains exactly how google does it. I think it's listed as one of the last (or the one before last) Greasemonkey hacks he has in that book, his Greasemonkey (javascript) hack circumvents those counter-measures -- so you can indeed save/print those pdfs wherever you want -- so he actually goes into detail in explaining those google counter-measures.

And of course, you probably wouldn't have to implement all those counter-measures. For your case, you could probably get away with using one or two of those tricks (and just say to your boss it's not fullproof -- nothing is).

Even Flash can be decompiled and reverse-engineered back to its original source files. Those tools are out there.

- spike

Last edited by quickspike (2008-01-08 00:07:03)

Re: Do not download my pdf !

Something to consider is Print2Flash ( I was going to use this for a similar project. When the PDF gets converted to Flash, you specify limitations on the resulting flash file's embedded navigation controls (ie. printing, but not copying, no printing, etc). There's a automated batch capability in some versions of their software. I've only used it to test with, so I don't know how well it works in a production environment.

Along those same lines, Adobe FlashPaper can do something similar, but it appears to be a dead product and customization seems more limited.

Hope that help... Scott