What if someone saves the file to their local computer... Then there is no
Yes, I'd like to document only to display on initiate if the domain is correct. So if they were to save to a local system not within the network it would not display.
Are you talking about an internet domain (like "adobe.com") or about a
local network domain?
My apologies, yes a network domain.
1 person found this helpful
Well, the way it can be done is with a script. I'm not sure how your network is set up so I'll give a general example.
You look at the path property of the file and do your test on it. If it fails, you close the document. So in the code below I will make sure that the file is located in the folder "C:\Temp", or any of its sub-folders (I'm doing this with the help of a regular expression):
if (/^\/c\/temp\//i.test(this.path)==false) this.closeDoc(true);
Couple of things to notice:
- The internal path syntax of Acrobat is different to the usual one. The path of the file saved as
- This code should be embedded in the document as a doc-level script, outside of any functions, so that it will execute when the file is opened.
- This "security measure" can be easily overcome by the user by disabling JS, for example... So use at your own risk.
- To find out the path of a file open it in Acrobat then open the JS console (Ctrl+J), enter this code:
and then press Ctrl+Enter.
Thank you very much this works in this case.
Ideally I'd like to allow authorized users to save documents down to any local folder but only if they are on a networked system and are logged in.
To address the JS enabled, the document will be blocked out by default, on open block out is made invisiable so if JS is disabled the doc will not display.