These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Protecting a PDF document

pdfer
Registered: Dec 23 2010
Posts: 28
Answered

Hello all,
I have just signed up for this website and love it. What I would like to ask is - Does anyone know how to protect a PDF document? I don't mean with just a password. I've already done that. I mean like to expire my document after so many times opened or an amount of time.
 
I have heard of this thing called "Nagware". Which is supposed to pop up a alert window asking for some money or whatever. Then after so many times using the document it would pop another window with a more serious alert message. Then after a set amount of time a pop up would white out the document rendering it unreadable and unusable. I've tried and it doesn't work for me. I'm just making an example mentioning this method. But, it sounds like a great way to render a PDF document useless. Which is ultimately my goal.
 
It is imperative that my document can be viewed but it is equally imperative that my document cannot be misused. Thus the reason for the top security. An expire date would be ideal. But, if anyone knows any other way to expire and/or protect a document, please, by all means let me know.
 
I am a Mac user using Acrobat Pro 9. Thanks.
 
Jackson C

Jackson C.

My Product Information:
Acrobat Pro 9.0, Macintosh
maxwyss
Registered: Jul 25 2006
Posts: 255
Accepted Answer
Essentially, it would work. There are a few things to keep in mind, however:

a) what happens if the end user has JavaScript disabled?

b) what happens when the end user uses another viewer than Adobe Reader?

c) for counting the times the document got opened, you would have to write back the document (which would require extended user rights), although if you do not have many such documents, there would be a workaround)

d) how "strong" should your protection be?


The workaround for a) and b) is the same: you provide a document which is whited out (for example putting a covering field on every page), which you hide using JavaScript when you open the document. If JavaScript is not available (by being deactivated or because the PDF viewer does not handle it), the document will be blank (and the user getting annoyed ).For c), you could, use a persistent global variable. Although the use of these things has been crippled over the versions, for a few documents, it still can be useful. You would make this persistent global variable a counter which you evaluate and then increment every time you open the document. With the evaluation, you are free to do whatever you want.

However, using an expiring date would be simpler to implement. When you open the document, you compare the actual date and time with a reference value and act accordingly.

This brings us to d), where you have to decide how strong the protection has to be. Using Acrobat JavaScript is a rather weak protection which can be overcome easily. If that is not strong enough for you, you will have to look at a Digital Rights Management system, where several ones are on the market, such as from FileOpen or Adobe. You then will have to decide how much the security is worth to you.

Hope this can help.

Max Wyss.


pdfer
Registered: Dec 23 2010
Posts: 28
Thanks for your input, Max. Definitely food for thought. But, the people which I will give my PDF document to, will use the Reader. Also, I don't believe they have the knowledge to know about turning Javascript off or would be wanting to learn anything further about Acrobat creation to bypass the scripting. At least that's what I'm banking on. So the protection doesn't have to be iron clad strong. At least for this one doc.

So, getting back to my issue at hand.The protection, at this point, needs to be a part of the document and not be an online service or anything complicated. I liked the idea of the "Nagware". Although, the protection doesn't have to be nagware. I would be willing to try using Javascript. Mainly because when the user gets terminated they would contact me.

I downloaded a few articles from acumentraining.com which contained the Javascript but I couldn't figure them out and any of my attempts did not function the way they claimed in the article. I thought, perhaps, the year the articles were written (I think it was 2004) was relating to a Javascript that is no longer compatible with the Acrobat Pro 9 and Reader 9. I don't know for sure and I'm not anywhere close to being an expert to make that assessment.

Well anyway. I like the idea concept. Throwing up a few warning pop alert windows then ultimately whiting out the document sounds perfect. In a sense securing my document. I know it isn't the professional way. Using a DRM system would be real secure, but, honestly I just want to terminate the usage of my document in, let's say, two week from the first time opening the doc using Acrobat Pro or Reader. That's all I need.

You mention in your post "using an expiring date would be simpler". Well, this was my original idea. But, I could not find any help nor instructions to implement this. Would you know where I can find the instructions to do this. Would it be a Javascript to enter into my doc? Would you know how to get this done? That would be a great help to me. Please let me know.

Thanks for your time.

Jackson C

Jackson C.

UVSAR
Online
Expert
Registered: Oct 29 2008
Posts: 1357
Is there a specific reason why you can't use an online solution?

LiveCycle Policy Server can make a PDF file expire after a certain time, and is effectively uncrackable. The user needs to connect to the server at least once when first opening the file, but after that they can stay offline and Acrobat/Reader will abide by the policy.

You can try LC for free via the Adobe Document Center website.
maxwyss
Registered: Jul 25 2006
Posts: 255
The expiration date concept would be implemented in a document level JavaScript or in a pageOpen script on the page the document opens. It uses the Date object, which is part of the JavaScript Core, which is not documented in the Acrobat JavaScript documentation (but has a link from there to it).

The implementation could look somewhat in this line:

var refDate = new Date(reference date) ; // creating a Date object from the reference date

var refDateMls = refDate.toString() ; // getting the reference date in milliseconds since JavaScript reference date

var now = new Date() ; // a Date object of "now"

var nowMls = now.toString() ; // getting now in milliseconds since JavaScript reference date

if(nowMls > refDateMls) {
// we are beyond the reference date, so nag, shout or watever
} else {
// we have not yet passed the reference date, so open the document etc.
}

And that's about it.

Turning on and off JavaScript is kind of easy, as the user can do that in the Preferences, and (unfortunately) whenever there is a vulnerabilty from Flash in Acrobat, the recommendation is to turn off JavaScript…

Anyway, this solution is simple, cheap, but not very hard. But it may be sufficient for your purpose.

With Right Management systems, it is pretty much "you get what you pay (…and if it says Adobe on it, you pay a premium…)", and "you have to decide how much the protection is worth to you".

HTH.

Max Wyss.

pdfer
Registered: Dec 23 2010
Posts: 28
The main reason for using a Javascript, for me, is my doc is all Javascript. And, many people want to access and use the info in the doc. And, I want them to use my doc. So, they have to leave Javascript Enabled. That being said I now can implement the Expire code using Javascript.

I got the Expire code to work. Just the way it should and the way I want. I have put it in the PageOpen. It shuts down the doc like clock work. But, what I've found out is, if the viewer sets his or her computer's Clock/Date setting to prior the Expire date they have successfully hacked in the doc. Although they couldn't leave their computer's setting like that, and would have to make this adjustment every time. But still, I still like using this Expire code. But, does anyone know how to Expire the doc (even if the viewer does reset the computer's settings).

I'm looking for a Javascript that would do. Kinda like - if the dates and times are not the same as in the Expire Javascript code - then do this - Quit/Close. The dates and times have to match or the doc will Quit. If I can get that then I'll feel pretty confident with the doc's protection. Can any one help?

Jackson C.

DaveyB
Registered: Dec 10 2010
Posts: 70
Hi pdfer,

I have just replied to your last question in another topic. Please don't cross-post questions here, it just makes things harder for those of us that volunteer our time to answer them.

Thanks!

DaveyB

LiveCycle Designer 8.0
"Genius is one percent inspiration, ninety-nine percent perspiration." ~~ Thomas Edison
"If at first you don't succeed, get a bigger hammer." ~~ Alan Lewis
"If the conventional doesn't work, try the unconventional" ~~ DaveyB