Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3666
  • Last Modified:

No Cache PDFs

I am building a bunch of PDFs with fillable form fields for work.  I will host these PDF's online (company website).  I've already figured out how to clear these forms when they are loaded using the attached code.
This function works great when the PDFs are stored locally (on the computers hard drive) but I noticed when the PDFs are hosted online the data doesn't get cleared.  So if a user logs into a PDF from their web browser and then goes back into the PDF at a later point in time the data they entered into the form remains :(

How can I make sure the data doesn't get cached in a browser?

p.s. I am using "Adobe Acrobat Pro v7" to create these PDFs
// variable to store whether document has been opened already or not
var bAlreadyOpened;
 
function docOpened()
{
 
  if(bAlreadyOpened != "true")
  {
    // document has just been opened
    this.resetForm();
    // now set bAlreadyOpened to true so it doesn't
    // run again
bAlreadyOpened = "true";
  }
  else
  {
    // document has already been opened
  }
}
 
// call the docOpened() function
docOpened();

Open in new window

0
basskozz
Asked:
basskozz
  • 2
2 Solutions
 
Karl Heinz KremerCommented:
There is a setting in Adobe Reader/Adobe Acrobat that determines if a form gets cached locally. You have to set this on every computer that you want to use the form. Open up Acrobat's preferences and go to the "Form" category. Uncheck the setting "keep forms data temporarily available on disk".

You could add some logic to your form that determines when the form was last used (e.g. save a date in a hidden form field). If the date is older than the current date, ask the user if they want to clear the form data. Other than that, you need access to your clients computers, or instruct them to uncheck that setting manually.
0
 
basskozzAuthor Commented:
Nevermind...
I found this: http://support.adobe.com/devsup/devsup.nsf/docs/53773.htm


this.nocache = true;

Open in new window

0
 
Karl Heinz KremerCommented:
Just keep in mind that this property was introduced in Acrobat 7, so for any older version of Acrobat or Reader, it's still necessary to use the setting in preferences.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now