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

Check PDF file Update

kb0000
Registered: Jan 14 2011
Posts: 2

Please tell me is this possible:
If a user downloads a PDF file and opens it, and if the user is connected to Internet (when he opens a PDF file) then this particular PDF file should check if a new version or an update is available for this file (it should check from the original source from where it was created).

KB

UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
You can do this with a DRM solution such as Adobe LiveCyle, which permits a document creator to "expire" any remote copy and automatically issue a replacement.

There are some workarounds to do the same thing with JavaScript, but it's not as reliable, and you wouldn't be able to force the user to update.
kb0000
Registered: Jan 14 2011
Posts: 2
How to do it with Javascript, because I dont want user to force update.
What I want is:
When user opens a PDF file, then this file should check if it is the latest version. If it is not the latest version, then it should ask user if the user wants to update to latest version of file.

Please tell me how to do it and by which software I can do this.

KB

UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
I called it a "workaround" as it's far from simple, so if you're not experienced in Flash and Acrobat scripting, don't expect what follows to make much sense:

As the JavaScript NET object in Adobe Reader does not permit reading of external URL content unless the SOAP extension is enabled (which requires Adobe LiveCycle), the 'free' way for a document-level script in Reader to interrogate a remote URL is to embed an invisible Flash annotation onto the PDF using Acrobat Pro, within which the ActionScript exposes a proxy function to the JavaScript API (Flash annotations are permitted to access external URLs, but the user will always be shown a warning message about allowing network access being a security concern). Within the PDF's doc-level script, the exposed Flash proxy function can then be used via the callAS method of the annotation, for example with

var isOld = this.getAnnots(0)[0].callAS("checkVersion",this.info.DOCID);
if (isOld) app.alert("You must update this document");

DOCID is a custom PDF property you set for each version that the ActionScript function passes to your server (the URL of which is set in the Flash widget), and the checkVersion function then returns true or false to the PDF host, which takes some kind of action to notify the user. You'd need to handle all the exceptions gracefully, as timing between JS and AS is not reliable.

As you're relying on JavaScript and ActionScript, this idea will only work in Adobe Reader 9+ or Acrobat 9+, and if the user disables scripting or clicks "Deny" on any of the security warnings the whole thing will break. Using LiveCycle DRM is far simpler and doesn't rely on the user having particular things turned on, but LCDRM is an enterprise solution and comes at a cost.
try67
Expert
Registered: Oct 30 2008
Posts: 2398
kb0000, you might find this tool I've created useful for that purpose:
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