39 Replies Latest reply: Mar 12, 2009 7:48 AM by (JRG) RSS

    How to set a PDF to expire (Working Script)

      Here is a little script I made up the other night. You can use it to allow a PDF to be opened only until a set date. I use this for when my employees go to service a customer. I want them to be able to see the customer's information, but only for 24 to 48 hours.<br /><br />CheckExpiration()<br /><br />function CheckExpiration()<br />{<br />/*-----START EDIT-----*/<br />var LastDay = 21<br />var LastMonth = 3<br />var LastYear = 2008<br />/*-----END EDIT-------*/<br /><br />/* DO NOT EDIT PAST HERE !!! */<br />var today = new Date();<br />var myDate=new Date();<br />LastMonth = LastMonth - 1<br />myDate.setFullYear(LastYear,LastMonth,LastDay);<br /><br />if (myDate<today)<br />  {<br />    this.closeDoc(1);<br />    app.alert("This files has expired.",1,0,"Expired");<br />  }<br />}
        • 1. Re: How to set a PDF to expire (Working Script)
          Patrick Leckey Community Member
          Well, as long as the user doesn't change the date on their computer or turns off JavaScript in Acrobat. If a user does either of those things, the form will open regardless of your script.

          Adobe LiveCycle Policy Server provides this functionality in a server / client setup so that it authenticates the user, date and time against a trusted server before the form is opened.
          • 2. Re: How to set a PDF to expire (Working Script)
            Patrick Leckey Community Member
            Actually that was the name for the LiveCycle version 7 suite. In version 8 the product that provides this functionality is called LiveCycle Rights Management.


            It does not use scripting of any sort and so it cannot be so easily disabled as by removing a check from a preference setting or by changing the year on your clock to 2007 (since the script above does not have a start date to validate against either). It is embedded into the document and forces Acrobat or Reader to validate against your Rights Management server before you are allowed to open the document.
            • 3. Re: How to set a PDF to expire (Working Script)
              If a fairly technical person with nearly no coding skills (for example, a person like ME...) wanted to use this script, just what does it take to implement.

              I totally understand that it is limited to 'keeping honest people honest' and has nearly zero "real" protection.

              However, I have a request from an associate to protect pdfs by date and he wants it quick and cheap..... (we don't have tons of servers or want to acquire the know-how of maintaining them ourselves).

              We've been trying the ADC, but have issues with it opening files on a Mac. Other solutions look nice (FileOpen, etc.), though they are a bit pricey-er than we'd like since the main thing is simply to have docs expire on a given date (we like the 'by user' features, but that's really not a huge requirement at this time).

              Thanks for your input.
              • 4. Re: How to set a PDF to expire (Working Script)
                (Aandi_Inston) Community Member
                Be very sure to explain to your associate: here is a solution, but the
                end user only has to turn off JavaScript to avoid it.

                Aandi Inston
                • 5. Re: How to set a PDF to expire (Working Script)
                  (SteveMajors) Community Member
                  Thanks, Aandi.

                  I clearly understand that and have tried to tell him, but 'pictures speak louder than words' and seeing it happen (or not) will likely help him understand everything.

                  What I have found (by studying the help files all weekend) is ONE way to implement this Java code (I'm not sure if it is 'right'...) that WORKS on ONE OUT OF SIX computers...

                  I placed the code on the Page Properties of the first page (steps below for the 'newbies' like me...) - it was really simple once I found out how to do it...

                  **** STEP BY STEP FOR OTHER NEWBIES ****
                  To use the Java script as described in this post (at least, as I did - maybe someone else will have better ideas and describe it for us...)

                  1. click on Pages on the left sidebar
                  2. right-click on the first page
                  3. select Page Properties, Action
                  4. under Select Action choose Run a Javascript
                  5. click Add
                  6. in the window that pops up, copy/paste the code from the post
                  7. click OK, OK to get back to the doc (change the Javascript later if you want, this is just 'initial testing'...)
                  8. IMPORTANT! Save the file under a different file name (or you may not be able to open it later!)
                  *********END OF STEP-BY-STEP*********

                  I included #8 because now, when I try to open the 'expired' doc in Acrobat, I get the 'expired' message and can't open it at all, but in IE, I see the document - on 5 of my 6 computers (including the one that Acrobat won't open!)

                  So, even though this is not 'secure' nor a 'pro' solution, please help me understand if a) I did this right and b) why it only works on the ONE computer (running Win 2000 Server and IE 6 with Reader 7) and not on any others (incluing NT, XP, Vista and 2000 Pro with various versions of IE and Reader).

                  Thank you for your time.

                  What I would really like to see is your reply with DETAILS on how to test this and both 1) learn how this stuff is done and 2) show my associate the difference in turning it 'on' and 'off'.

                  Best regards

                  Steve Majors
                  • 6. Re: How to set a PDF to expire (Working Script)
                    (Aandi_Inston) Community Member
                    One tip is to always check the JavaScript console. There may be a
                    message in there about the problem.

                    Aandi Inston
                    • 7. Re: How to set a PDF to expire (Working Script)
                      (SteveMajors) Community Member

                      Thanks. Sure wish I knew what that was, or where to find it....

                      guess it's back to the 'search the help file' again.....

                      I really do thank you (and all the experienced folks out there) for your tips/guidance, however, PLEASE remember that I got Adobe Acrobat last week (haven't even received the CD yet...) and I'm about as lost as anyone can get! (step-by-step is highly appreciated... - not only for me, but in reading the forums, it seems there are many more out there as bad, if not worse off than me!)


                      P.S. (added after doing some searching) I found that "Javascript console" is something that browsers have.... check out http://www.webmonkey.com/06/19/index3a.html for a nice page... They say, "In IE, go to Tools > Internet Options and choose the Advanced tab. Make sure the check box for "Display a notification for every script error" is checked. " I'm off to try that....

                      P.P.S. Turned that on, tried the 'expired' page and nothing special - was able to read the entire thing...
                      • 8. Re: How to set a PDF to expire (Working Script)
                        (Aandi_Inston) Community Member
                        They now call it the JavaScript debugger in Acrobat Professional, look
                        under Advanced > Document Processing. Not sure about other products.

                        Browsers have a different JavaScript environment to Acrobat; each one
                        may have a console, but when running Acrobat JavaScript you need the
                        AcrobatJavaScript console.

                        Please remember that you are now learning to be a programmer, and that
                        isn't something you can get good at in a day, a week, or a month; nor
                        through a handful of tips.

                        Aandi Inston
                        • 9. Re: How to set a PDF to expire (Working Script)
                          (SteveMajors) Community Member
                          Thanks for the message with details!

                          When I turn on the JavaScript debugger in Acrobat Pro, I get this message (whether the 'clean' file or the 'expired' - same message).

                          Don't know if it has anything to do with the issue, but it is what it is...

                          Acrobat Database Connectivity Built-in Functions Version 8.0
                          Acrobat EScript Built-in Functions Version 8.0
                          Acrobat Annotations / Collaboration Built-in Functions Version 8.0
                          Acrobat Annotations / Collaboration Built-in Wizard Functions Version 8.0
                          Acrobat Multimedia Version 8.0
                          Acrobat SOAP 8.0

                          NotSupportedError: Not supported in this Acrobat configuration.
                          Doc.closeDoc:17:Page undefined:Open

                          As for being a 'programmer' - that ain't gonna happen.... I've been in computers since 1978 (Apple ][ days...) and found out a long time ago that I don't think like a programmer (it takes a special person with special skills and dedication, IMHO...), though I do like to 'hack around' and try out the simple stuff on my own.

                          What I'd really like to do/have/find is someone that totally understands this stuff as well as the business side of things that will stick to being 'on staff' (what we find is that "programmers" tend to get the majority of the project done, then something else comes along.... - certainly on the bigger projects.... we have a mostly-written back-end project done in perl, but now the programmer isn't answering the phone, or not getting into it to finish....

                          That's why I like to 'hack' - small changes are something I can do myself.

                          Anyway, I think this has gone as far as I want to go with it - something that 'kinda' works on one out of 6 computers seems to me to be a FAILURE, not an OPTION....

                          Thanks for your replies and the instructions on how to at least look at the debugger thing.

                          All the best.
                          • 10. Re: How to set a PDF to expire (Working Script)
                            (Aandi_Inston) Community Member
                            >NotSupportedError: Not supported in this Acrobat configuration.
                            >Doc.closeDoc:17:Page undefined:Open

                            Ok, if we refer to the JavaScript Reference there may be some clues
                            there. It's basically saying that closeDoc (which you'll find in the
                            code somewhere) isn't being allowed, usually for some security or
                            impracticality reason, rather than because you didn't ask right.

                            But no: no useful notes. It may be that you are trying to do this in a
                            browser document? You can't close the document window for a browser.
                            >As for being a 'programmer' - that ain't gonna happen....

                            It's already happened. You may feel you're just doing copy-and-paste
                            programming - but an increasing number of "programmers" actually
                            believe this is all there is to programming. I respect your judgement
                            that you don't want to be what you see a programmer as being, but you
                            are doing programming tasks, just as someone who has to saw a piece of
                            wood is doing carpentry tasks - and the saw is still sharp!

                            What I'm saying, I guess, is that trying to get this working while
                            simultaneously saying "No! I don't want to learn this stuff" isn't
                            going to work.

                            Aandi Inston
                            • 11. Re: How to set a PDF to expire (Working Script)
                              Patrick Leckey Community Member
                              Good catch, Aandi. Hadn't occurred to me until now. closeDoc does not work in a browser window, you're right. Since AcroJS stops processing at the first error, you never get the app.alert message because closeDoc comes before it, and you see the document because closeDoc can't close a browser window.

                              Just another reason why "JavaScript-based Document Security" is a misnomer and why this script really shouldn't be used for any sort of security - all you have to do is open the document in a browser to bypass the security.
                              • 12. Re: How to set a PDF to expire (Working Script)
                                When I attempt this.. I get to step 4 and then it will not allow me to Add...

                                Is there a specification I am missing... a file type.. or reason my PDF won't allow me to edit such things.
                                • 13. Re: How to set a PDF to expire (Working Script)
                                  GKaiseril CommunityMVP
                                  These instructions apply to PDFs NOT created by LiveCycle Designer.
                                  • 14. Re: How to set a PDF to expire (Working Script)
                                    Community Member
                                    Thanks Geo - that is my issue.

                                    Does anyone know if there is there a way to generate silimar results in designer? (an expiration by date, or number of times opened etc...)
                                    • 15. Re: How to set a PDF to expire (Working Script)
                                      Patrick Leckey Community Member
                                      You do understand that this method provides no security at all, right?

                                      Turning off JavaScript or changing the date on your computer will circumvent any form of "security" this script may seem to provide.
                                      • 16. Re: How to set a PDF to expire (Working Script)
                                        Community Member
                                        Yes, I understand there are obvious ways around it, but it is better than having no alternative.
                                        • 17. Re: How to set a PDF to expire (Working Script)
                                          Patrick Leckey Community Member
                                          The alternative is Adobe LiveCycle Policy Server.

                                          EDIT: Sorry, it's been renamed Adobe LiveCycle Rights Management for the LiveCycle ES Suite.
                                          • 18. Re: How to set a PDF to expire (Working Script)
                                            Two questions regarding the JavaScript approach...

                                            1) Is there a way to add this bit of JavaScript information to a pdf file in a batch fashion via Java, Python, etc.? I would like to add this to a build process in Ant. Any suggestions?

                                            2) The responses regarding how insecure this is and to use the client/server approach seems worthless for a situation where the pdfs may never see internet connectivity. The only reason for using pdfs is for mobile users of my information. That is first and foremost why I need some document-embedded solution. Are there any document-embedded solutions that are known that do not involve client/server communication?

                                            Thanks a lot for any assistance.
                                            • 19. Re: How to set a PDF to expire (Working Script)
                                              GKaiseril CommunityMVP
                                              And Acrobat JavaScript may not work on many PDA and other wireless devices that might display content.
                                              • 20. Re: How to set a PDF to expire (Working Script)
                                                Patrick Leckey Community Member
                                                They may be "worthless" solutions for non-internet-connect scenarios, but that doesn't make the implementation any more secure. It's still a laughably insecure approach to expiring a document. Unless you are in complete control of the viewing environment, I know for a fact that a lot of corporate deployments of Acrobat default to JavaScript turned off - which means to them, your document never expires. A lot of home users turn JavaScript off too because they don't "trust" JavaScript. Not to mention all the people that use non-Adobe viewers (Foxit Reader for example) that may not handle the JavaScript correctly and cause unknown results.

                                                There is no perfect solution for expiring a PDF in a non-internet-connected scenario. If you can't control the timechecking in a known-safe server environment and have to rely on information from the local system, your security it lost since anybody can do anything to the local system. If you're looking for something showy that will make people feel warm and think that you have some form of security on your documents, use the above script. But I would be weary about passing it off, especially in a professional environment, as "secure". Anybody who wants to spend 5 minutes on Google looking at PDF security will realize your "security" is a complete sham and that could reflect badly on you.

                                                The best option to secure a PDF in a non-connected environment is to apply document encryption and only give the password to those who need to view the document.

                                                Oh and LiveCycle Rights Management ES has plenty of fallback configuration options for how to handle non-connected environments with policy-protected PDFs.
                                                • 21. Re: How to set a PDF to expire (Working Script)
                                                  Do you know how to add a specific time to the expiry?
                                                  • 22. Re: How to set a PDF to expire (Working Script)
                                                    GKaiseril CommunityMVP
                                                    You need to add the variables for hours, minutes, seconds and milliseconds to the code. A generalized version that will work with omitted time elements follows.

                                                    function CheckExpiration(LastYear, LastMonth, LastDate, LastHour, LastMin, LastSec, LastMS) {
                                                    // document level function to see if passed date less than today's date
                                                    // check that numbers are passed as parameters
                                                    if (isNaN(LastYear) ) LastYear = 1900;
                                                    if (isNaN(LastMonth) ) LastMonth = 1;
                                                    if (isNaN(LastDate) ) LastDate = 1;
                                                    if (isNaN(LastHour) ) LastHour = 0;
                                                    if (isNaN(LastMin) ) LastMin = 0;
                                                    if (isNaN(LastSec) ) LastSec= 0;
                                                    if (isNaN(LastMS) ) LastMS = 0;

                                                    LastMonth = LastMonth - 1; // adjust the passed month to the zero based month
                                                    // make the expiration date time object a numeric value
                                                    var myDate = new Date( Number(LastYear), Number(LastMonth), Number(LastDate), Number(LastHour), Number(LastMin), Number(LastSec), Number(LastMS) ).valueOf(); // convert passed expiration date time to a date time object value

                                                    // get the current date time's object as a numeric value
                                                    var today = new Date().valueOf();

                                                    // return logical value of the comparison of the passed expiration date value to today - if true document has expired
                                                    return (myDate < today);

                                                    // the following code has to be executed after the above function is defined

                                                    // edit following fields
                                                    var ExpireYear = 2008; // 2008
                                                    var ExpireMonth = 3; // March
                                                    var ExpireDate = 21; // 21st
                                                    var ExpireHour = 12; // noon
                                                    var ExpireMin = 0;

                                                    // the following code has to executed after the above function and variables are defined.

                                                    // test for expired document based on result of the passed time elements compared to the current date and time as returned by the CheckExpiration() function.
                                                    if (CheckExpiration(ExireYear, ExpireMonth, ExoireDate, ExpireHour, ExpireMin) ) {
                                                    app.alert("This files has expired.",1,0,"Expired");
                                                    • 23. Re: How to set a PDF to expire (Working Script)
                                                      Yes the script does work to expire the pdf, however you can still open the pdf file through Photoshop or Illustrator even though it has expired. Is there any other solution?
                                                      • 24. Re: How to set a PDF to expire (Working Script)
                                                        (SteveMajors) Community Member
                                                        Here's a slightly different method, but it works..... (and, there is certainly no 'work around' for anyone to get data you don't want them to get!) <br /> <br />It uses the Action on Open (sorry, I don't know the 'official' name of this - I'll describe it below..) in the pdf to send the user to a server checking mechanism (in this case, a date checker - but you could do the same thing with lots of stuff...) <br /> <br />Here's how I set it up and it works great! <br /> <br />1. Start a new document that you can get a form field into (don't use LiveDesign for this - that's too fancy... - just make a document in Word that says ______ then print to pdf to get a nice simple pdf that you can edit directly in Acrobat) <br /> <br />2. Do a 'Run Form Field Recognition' and Acrobat will find the blank as a field. <br /> <br />3. Edit this field to have a "key" name (my example, I will use "today" which tells me this is the day that my document starts). <br /> <br />4. Under the 'Options' tab, make a Default Value of today's date (this will be the 'test against' date - for my example I'm showing how to expire a document in 30 days from creation date, but you could use anything you like - it is simple to modify!) <br /> <br />5. From the 'Format' tab, use the Select format category of Date. Use a date format you like (my example uses mm/dd/yyyy) Note that this MUST match the server side code described later). <br /> <br />6. For a 'live' document, you may want to go to the General tab and make the field Hidden as well as other things to not see the 'false' page, but that is outside the scope of this example. <br /> <br />OK, now on to setting up the document to automatically send this info to your server for testing... <br /> <br />1. Go to the 'Pages' view (click on the icon at the top left) <br />2. right-click on the page, select Page Properties. <br />3. Under the 'Actions' tab, select "Page Open" and "Submit a form" from the drop down boxes. <br />4. Enter a URL to your web page (see below) that does the checking (like http://mytestdomain.com/Scripts/checkexpiredate.php so it is easy to remember) <br />5. Check the HTML radio button. <br />6. Check the 'Only these...' button and then 'Select fields'. Make sure your "key" field is checked as well as the 'Include Selected' button (sometimes, for me, these weren't - I don't know why, so check it!) <br /> <br />Now, on to the server side... <br /> <br />Here's the code that goes into the php server file; <br /> <br /><?php<br />$day = date("d");<br />$month = date("m");<br />$year = date("Y");<br />$today = substr($_REQUEST["today"],3,2);<br />$tomonth = substr($_REQUEST["today"],0,2);<br />$toyear = substr($_REQUEST["today"],6,4);<br />  $tsp = mktime(0, 0, 0, $month, $day, $year);<br />  $tsd = mktime(0, 0, 0, $tomonth, $today, $toyear);<br />  $xdays = ($tsp - $tsd)/(24*60*60);  // as calculated from dates<br />$maxdays = 30; //set this to whatever your 'expire from today' date is<br />if ($xdays >= $maxdays)<br /> //do what you like to tell the user it is expired<br />else<br /> //show the info you want them to see<br />?> <br /> <br />i (the info shown (or not) is outside the scope of this message, this is just a 'one way to make this work' example. In my system, I use a program called fpdf [http://fpdf.org] to create the pdf from 'scratch', building it to show the reader what I want them to see - whether it is a "Sorry, this is expired" document, or the data that they came for if the time hasn't expired.) <br /> <br />THAT'S IT!!! It works great and you can use it to do tons of stuff - just set the "key" on the original document and make the server code check whatever it is you want! <br /> <br />Pretty cool, I think! (and, it only took me, a novice programmer, about 3 hours to figure it all out!) <br /> <br />Best of success with it - enjoy!
                                                        • 25. Re: How to set a PDF to expire (Working Script)
                                                          Community Member
                                                          Thank you for your time Steve.

                                                          Sorry I should have been a little more clearer, I am actually a designer (not a programmer)
                                                          so the above is a little overwhelming, are you able to set it out step by step?

                                                          Basically what I am trying to do is to set an expiration date on pdf files that I supply to my clients, so that once the file has expired it also can not be opened and edited via Photoshop/Illustrator should the pdf file land in the hands of another designer.

                                                          Is this possible?
                                                          • 26. Re: How to set a PDF to expire (Working Script)
                                                            Bernd Alheit CommunityMVP
                                                            Use digital rights management (DRM) software.
                                                            • 27. Re: How to set a PDF to expire (Working Script)
                                                              Community Member
                                                              Can you recommend any? I am a mac user. I don't have a big budget I am a freelancer?
                                                              • 28. Re: How to set a PDF to expire (Working Script)
                                                                (SteveMajors) Community Member
                                                                try Adobe Document Center. you will need Acrobat 9 for a Mac (as I understand it - I have a client that told me that yesterday...)
                                                                • 29. Re: How to set a PDF to expire (Working Script)

                                                                  I have posted the same problem in forum at:

                                                                  M. Ahmad, "How to close a PDF doc opended in IE web browser using JavaScript?" #, 16 Sep 2008 6:44 am

                                                                  The example of my script works in pdf but not in browser, as most of you are having the same problem.

                                                                  I will just say:
                                                                  1) SetPageAction is not the right place to put your javascript for this purpose. As the script will not run untill file is not opened to that page or user does not go to that page.
                                                                  2) I put this script as Document Level Script and that way it will run as soon as the file is opened.
                                                                  3) Yes, the script can be added to one file or a group of files through BATCH PROCESSING. To do this you have to write another script to add this expiry script to the file/files automatically thorugh batch processing

                                                                  4) I agree, it is not the true security but it is better than having nothing at all.

                                                                  • 30. Re: How to set a PDF to expire (Working Script)
                                                                    GKaiseril CommunityMVP
                                                                    Just be aware that any user who turns off JavaScript in their copy of Reader or Acrobat will not be restricted by this approach.
                                                                    • 31. Re: How to set a PDF to expire (Working Script)
                                                                      Bernd Alheit CommunityMVP
                                                                      Or any user with an other PDF viewer.
                                                                      • 32. Re: How to set a PDF to expire (Working Script)
                                                                        I am interested in enabling the method of SteveMajors - Aug 1, 08 PST (#24 of 31). I have tried doing it, but it is beyond my knowledge of what i need to do or how to do it.

                                                                        I don't know if or whether the options he advocated are necessary or not. I believe he was populating his form from his server, so disabling the script blocks access to the file as well. However, I would like to start with something simple like just the date being sent from my server.

                                                                        I think my problem is in properly setting up the .php code and capturing it in acrobat (instruction #6).
                                                                        • 33. Re: How to set a PDF to expire (Working Script)

                                                                          Using SteveMajor's method of having the pdf checked against a script on a website, is it possible to cross check against the date a pdf is created on the user system with a expiry. To put it simply, i want a user downloading a copy of pdf from my intranet to be able to use it for 24 hours only (the counter starting from the time it is downloaded on the user system). This is to ensure some form of document control / version control.

                                                                          • 34. Re: How to set a PDF to expire (Working Script)
                                                                            Allegra Pilosio, you said the script to expire PDF is working. To restrict opening the file in Illustrator or Photoshop, you can set the document secruity in PDF.

                                                                            Use clt+D or Cmd+D, choose password security
                                                                            Compactibility: Acrobat 3 or later
                                                                            Encrypt All document contents
                                                                            Set a Password
                                                                            Printing Allowed: High Resolution
                                                                            Changes Allowed: None

                                                                            Thats it, people can't open your PDF in Photoshop or in Illustrator without knowing the password
                                                                            • 35. Re: How to set a PDF to expire (Working Script)
                                                                              Too bad we can't turn this around and somehow require Javascript is ON and then proceed. Maybe a pair of documents, first one that checks for Javascript that shows a link to the second document with the time sensitive data. Again, not a long term solution.
                                                                              • 36. Re: How to set a PDF to expire (Working Script)
                                                                                DimitriM CommunityMVP
                                                                                Hi Melissa,

                                                                                Yes, the problem with all these solutions is that in order to make them work JavaScript must be turned on. But your mention of a "cover" document explaning to the user that JS must be turned on is possible. There is an example PDF at-

                                                                                AcroDialogs Product Page

                                                                                Scroll down to the link for "Document License Dialog Example" to download it. If the user does not turn JS on then they cannot view the information under the "cover" layer. If JS is already turned on then they can view it.

                                                                                Again, this is not an airtight security method, just a pretty good deterrent.

                                                                                Hope this helps,

                                                                                WindJack Solutions
                                                                                • 37. Re: How to set a PDF to expire (Working Script)
                                                                                  Not a big expert on wondows active directory but I am sure within active directory there is an option to force users not to be able to switch off programs like javascript.

                                                                                  The solution you have proposed here is actually quite handy. As mentioned this is really to help protect honest people. If you need something more secure I would suggest looking at windows active directory, although off course you need to be running this service in the first place.

                                                                                  Regards. Peter.
                                                                                  • 38. Re: How to set a PDF to expire (Working Script)
                                                                                    try67 CommunityMVP
                                                                                    Switching off JavaScript can be done from within Acrobat, so Active Directory can't prevent it. The layer option is good... I thought of another one -- hiding the pages in templates that are made hidden only when JavaScript is enabled and the script has not yet expired. Of course, an experienced user can display the pages themselves, but it would work for most.
                                                                                    • 39. Re: How to set a PDF to expire (Working Script)
                                                                                      I'm not familiar with the JavaScript API, but is there a way to modify document appearance with the API? If so, then the document could be rendered in an unreadable format (e.g. white print on white background) and the JavaScript could check the date and modify the appearance. Thusly, if JavaSript were disabled, the document could be opened but not "used".

                                                                                      Yes, I understand that any of these measures can be likened to a lock on a screen door, but sometimes that's all you need to redirect the actions of the "almost honest".