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

Javascript for .pdf file Properties|Location:

TUNITUP
Registered: Jun 5 2008
Posts: 9

What is the Javascript code for "Location:"?

Please refer to the File pulldown menu 'Document Properties | Description tab | Advanced | Location:' in any .pdf.

I am presently using Adobe Acrobat 7.0 Professional.

Thanks ahead of time.

My Product Information:
Acrobat Pro 7.0, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
You can use the document's "path" property. You can run the following script in the JavaScript Debugging console and see some the different document file path and name variables:

console.println("baseURL: " + this.baseURL );
console.println("documentFileName: " + this.documentFileName );
console.println("path: " + this.path );
console.println("URL: " + this.URL );

George Kaiser

TUNITUP
Registered: Jun 5 2008
Posts: 9
Any way of getting Javascript to give the Local Platform Path instead of the Acrobat Device Independent Path? (Please refer to Thom Parker's "File paths in Acrobat JavaScript" to see the difference in the Windows Platform definition.)
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
I believe the article discusses how Acrobat/Reader needs the device independent path name, which is the PDF standard, and the OS dependent path and how to create the necessary string for Acrobat JavaScirpt.

If you use the "platform" property of the application object, you will know the OS platform anc could split the device independent path into each directory level and device name and then reconstruct the OS device dependent name.

George Kaiser

TUNITUP
Registered: Jun 5 2008
Posts: 9
Very interesting that Acrobat would even show the Local Platform Path if we can't readily use it.

My gripe is that this is standard procedure in CAD software, i.e. "plot stamp". An AutoCAD .dwg file will automatically (dynamically) update the textbox with the Local Platform Path&documentFileName if the file is moved to a different file folder. And you can see the text change instantly when renaming or moving the file.I would think there would be many folks out there using the Windows platform that need this capability when all they have been given is a .pdf in hard copy form and don't have a clue as to where the electronic copy is located.

Thanks anyway for your input.
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
It shows the path because one is on a given system and the system is passing the device dependent path string to Acrobat. But when one has to program a script one would either have to check the OS each time the JS action is taken and try to write the device dependent code for that OS or use a device independent code and let the specific application in the specific OS resolve the exact OS file name and device as needed. After working in environments that consist of multiple OS networked, device independence makes life much easier for application coding by the novice user. Can you imagine how much fun it would be if one had to locate program appliction files or directories with device dependent strings and then try some manipuilation to another OS?

You might be able to write your own plugin to provide what you want, but you will then need to get each user to install this on their system or get their IT function in a large corporation to install it. There is enough resistance to Acrobat/Reader by IT functions because it uses JavaScript and the IT security officer does not realizel how limited the OS interface is due to Adobe's great concern for security.

George Kaiser