Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Javascript in PDF

0 views
Skip to first unread message

jsma...@adobeforums.com

unread,
Oct 29, 2003, 12:54:51 PM10/29/03
to
I realize the Acrobat forum isn't exactly the best place to ask a JS question, but maybe someone can help me since it involves Acrobat?

I have some PDFs I am posting to our Intranet. The Save function in the
browser is disabled due to the PDF security settings, but once viewed
through a browser the Acrobat Save button is active. This is just a fact of
life when viewing/distributing PDFs on the web.

We can't disable save, so what I want to do is redirect the user to a
different page of the Intranet if they try to save. Acrobat permits JS to be embedded in the document, so I wanto to put the script under the Document Will Save JS option. However all the lines of code I have tried don't work.

For example:
window.location('http://www.webpage.com');

Causes the error "ReferenceError: window is not defined" in Acrobat. I am
not sure what this means.

Can anyone help? <:-)

TIA,
Webfairy

Aandi_...@adobeforums.com

unread,
Oct 29, 2003, 2:20:10 PM10/29/03
to
The error means that you are trying to use the "window" object which
does not exist. That is in browser JavaScript only. The Acrobat
JavaScript reference gives the completely different set of
objects/classes in Acrobat JavaScript.

Aandi Inston

jsma...@adobeforums.com

unread,
Oct 29, 2003, 3:13:03 PM10/29/03
to
Aaah, yes I see that now. I did find the app.execMenuItem("close") but of course you can't save a file when you have just told the JS to close the application when you save! So we are going to try to go in some back way and do some scripting magic. If this works, it will be a neato way to help keep less technosaavy folks from saving our PDFs!

If we do come up with a solution I will post it here for posterity :-)

Shawn_S....@adobeforums.com

unread,
Oct 29, 2003, 4:36:14 PM10/29/03
to
Just to make a note: remember that a user can easily disable JavaScript within Acrobat, so using it for security features isn't very solid.

However, as you said, it will help with those less tech-saavy.

0 new messages