Tuesday, April 25, 2006

Web-based document copy/print/save protection

We recently needed to publish some documents which required some fairly strong restrictions on usage (viewing only ... in other words no printing, no copying, and no saving). Even though I find these restrictions to be a little draconian for something destined for the Web, I always try my best to accommodate any requests.

Initially I had posted the documents in PDF format since it's easy and has built-in security against printing and copying. I had also thought you could prevent saving, but that turned out not to be the case, and something I didn't realize at first. Much fuss was made regarding this "problem" because we had signed a contract outlining the copy/print/save requirement in return for our usage of the documents.

Upon further investigation I found another problem in that the security features of PDF are voluntary to the reader. Naturally Adobe's products follow the restrictions, but it's possible that other products out there may ignore the restrictions.

Then there's always the fact that the user can just save the original file from the link to it (right click + "Save link as ..." from most Windows-basec browsers).

Many issues to consider with regard to this "no saving" clause. I think the tech group should have been consulted regarding the final contract. I don't think we would have ever signed off on that clause because it's the nature of the Internet ... in order to view something stored remotely it has to be copied locally. And even if you could prevent disc storage the document would have to be placed in memory on the local machine. So "no saving" is really a difficult problem to tackle.

But tackle it I did ... by moving to Flash. With Contribute 2 Macromedia provided a nifty little program called FlashPaper. FlashPaper is like a Flash version of PDF (or more accurately PDF lite). It's missing some featuers that make PDF useful but it pretty much serves the needs for this particular problem. I was able to make the document unsavable by using a shell Flash presentation to load the FlashPaper document. Now if someone attempts to save using the web browser's save functionality all they'll get is the shell Flash presentation.

One annoyance with this method is that the FlashPaper navigation bar no longer floats on top of the document. Viewing a FlashPaper document directly the toolbar maintains it's size and adjusts the number of on-screen controls available based on the width of the display window. If the presentation is resized with an embedded FlashPaper the toolbar resizes like any ordinary Flash object. Worst of all the toolbar buttons do not scale up very well.

That's just an annoyance, though. One important feature is lost by moving to Flash and that is the accessibility enhancements provided by PDF. When I scanned in the pages (as images) the PDF did some OCR magic so that the text of the documents was actually accessible to screen readers (awesome!). This is an incredibly useful feature that requires further investigation. At any rate, converting to Flash killed the OCRed text.

References:

Update 2006-05-09:
Note to self, pay more attention to what's going on around you. Apparently I did get a copy of the "contract" at some point and may have even signed off on it (though it's hard to say because it came via hard copy and has no date stamp). I'll keep this in my files as a sample of a bad contract.