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!