The PDF list is a service provided by PDFzone.com | http://www.pdfzone.com
__________________________________________________________________

> I'm designing an interactive PDF to be available via a link on the
> company website, and for security/privacy reasons we would like it to
> automatically reset when closing (to insure that nobody re-opening the
> form immediately afterwards through the same server has access to the
> previous user's information).

It's only a problem if someone uses the same workstation. A little background on the 
nature of this problem might be helpful. When a form is viewed in a browser and the 
form is closed, Acrobat will create a FDF to cache the form data and other properties 
of the form fields. It does this so that it can attempt to restore the form to its 
previous state if the user returns to the form. This is seen as a useful feature which 
prevents the form data from being lost if the user hits the browser's Back button, for 
example, and then returns to the form. If the browser is closed, Acrobat will remain 
running (perhaps hidden) and will auto-terminate (if hidden) after some time, usually 
several minutes. It will (or should) take any cached FDFs with it when this happens. 
But if the form is reloaded in the browser before Acrobat auto-terminates, the form 
will be restored to it's previous state.

As you've found, you cannot reset the form automatically when the form is closed. 
There are a number of approached to this problem:

1. Manually reset the form before it is closed. Obviously, this isn't a 100% solution.

2. It turns out that Acrobat will not create the cached FDF is the PDFs dirty flag in 
not set (true) at the time the PDF is closed. You can sprinkle the following 
JavaScript throughout your form in attempt to prevent the creation of the cached FDF:

     this.dirty = false;

Place it in Page Open/Close events, etc. This too is not 100%, but it helps.

3. Acrobat (Reader) 6 adds a user preference that prevents the cached FDF from being 
created. It was actually introduced with Reader 5.1, but the setting wasn't retained 
when Reader was closed, making it useless.

4. Reset the form when it is opened. This will clear the form data, but the FDF will 
still get created and stored on the user's hard drive, which may be a security 
concern. An example of this approach form multi-page forms is available at 
http://www.peakforms.com/pdfs/resetOnOpen.pdf

This example uses both a Page Open script on the initial page and a document-level 
JavaScript that runs when the PDF loads. You have to break it up this way because the 
form is restored via the cached FDF AFTER any document-level JavaScript code executes. 
For sinlge page forms you can simple reset the form in the Page Open event. Note the 
code that checks to see if it's being viewed in a browser. This is to prevent the form 
from being reset-on-open if the form is downloaded and being used outside of a browser!

#3 is the best approach, but for pre-6 versions I use a combination of #2 and #3.

Good luck.

George


To change your subscription:
http://www.pdfzone.com/discussions/lists-pdf.html

Reply via email to