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

How do I ensure this is the current document?

damps
Registered: Jan 3 2007
Posts: 2

When I create a new document in word and then export it to pdf for distribution, is there a set of javascript code that I can insert into the pdf file that will verify via the internet this document is at the latest level or instruct the user to get a newer version?
 
Management is concerned if too many download, they will eventually have an outdated copy and need to be told to get a newer release.
 
Is there a standard script available or can someone point me in the right direction or technique to do it or how should I react to the request from those experienced.
 
Thanks, newbee... Andy

Andy
Retired, USCGAux member, Central VA

My Product Information:
Acrobat Pro 9.4, Windows
Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766
Hi,

you can place the form on a serveur (eg : Acrobat.com), and give a link to people that need to download it, then they will alway get the latest version.

;-)
damps
Registered: Jan 3 2007
Posts: 2
Thanks for the feedback. I understand to place the form on a server. My concern is directed at how do I tell the document reader that they should go back to the server and download the latest because this one is now out of date or may be out of date. The assumption is the reader rarely visits the download document server unless there is a need. Trying to figure out if there was something that could be done using javascript built into the document itself. ie communicate with server and get current version number and compare with document version number. Other possibilities might be to simply show when opened the time that has passed since downloading and suggest a revisit if beyond a recommended time. Just wondering is this is feasible and something reasonable. There are many more experienced than me in this area. Thanks. Andy

Andy
Retired, USCGAux member, Central VA

try67
Expert
Registered: Oct 30 2008
Posts: 2398
This issue does indeed come up from time to time, but I don't know of a simple solution for it.
The best way I can think of is to write a script that uses the SOAP object to send a request to a web-service that you can set up on your server that will respond with the latest version number of your file. If that number is not identical to the current file's version number (which can be saved in the file's meta-data), then you can let the user know about it and prompt them to download the new version.
However, it's not trivial at all to create such a mechanism, I'm afraid.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

try67
Expert
Registered: Oct 30 2008
Posts: 2398
Just thought you might be interested to know that I've developed a tool that can help solve this problem.
For more information you're welcome to have a look at this page from my website:
http://try67.blogspot.com/2011/01/acrobatreader-check-file-version-online.php

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

gotwebpages
Registered: Apr 15 2011
Posts: 1
I know this is an old post however this is something I wanted to accomplish and I could not find a solution. Here is what I did.

On your website:
Create a document, name it whatever you want, in this example I will use "version" with no extension.
Open the file version in a text editor and put the version of the most current file. Lets say 1.1. So inside the file is just the text:

1.1

Upload the most current version of your pdf file to your server as well.

In your pdf file:
create two text fields on your document, name them, for example txtLocal and txtLatest, where local is the one they have local and latest is the most current version available. Create a regular button, name it update, and set its presence to invisible.

You need to put the code where it will run when the pdf is open, that is up to you, i use the initialize for one of the text fields above.

formcalc.

var localversion = "1.0" //You will change this on each new file you distribute
txtLocal.formattedValue = localversion
var latestVersion = get("http://www.yoursite.com/version") //it will save the contents of the file to your var
txtLatest.formattedValue = latestVersion
if (latestVersion > localversion) then
this.resolveNode("Update").presence = "visible" //make the button visible
txtLatest.fillColor = "255,0,0" //make latest version text box red
endif

for the button: you need an action to go to where your pdf is stored, you can use the action builder for this. Just create an action "when object (the button you created) is clicked go to a website. and put the url including the filename and it will download the file when clicked.

thats it. simple and free..

I have only been doing adobe pdf programming for a couple weeks so there may be cleaner ways of coding it, but that is the concept. It works in my pdf.

The user will have to allow the action of going to the website the first time, if they store the location in their trusted sites or whatever it is called in acrobat it will not prompt them anymore.

good luck

Erik