Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).

New Forum | Previous | Next | (P-PDF) Developers

Topic: Re: JavaScript - using 'openInPlace'
Conf: (P-PDF) Developers, Msg: 57559
From: prodok
Date: 5/29/2002 05:26 PM


It is one of these missing parts of Acrobat. There is a way to run scripts
when opening a document, but there is no "cleanup" possibility ... except
you have one-page documents, werhe you could use the Close Page Action. So,
it is not possible to reliably clean up the state you have encountered when
opening your document set.

However, particularly for the openInPlace function, this should be the
system default anyway. I still can not understand why Adobe refuses to
change this system default (but I am open to any good argumentation). But
anyway, it is not that critical to change the user's default in this case.
But I agree, for other defaults, we would need a way to reinstate the

If you have a proper way to leave your document set, you can of course use
a variable in which you write the current state of openInPlace and set it
when you are done with your document set.

Another possibility to keep in mind would be using buttons for opening
other documents. In this case, you can set the opening properties with a
FDF (/NewWindow true). I am not aware that this method would work with
normal links. However, it could be that the current (or an upcoming)
version of Ari's Link Tool by Daniel-Ari Feinberg of Dionis
( might have the possibility to control the opening
behaviour of the links. Maybe, if we very nicely try to persuade Daniel-Ari
into providing this functionality...

The JavaScripts directory name is indeed one of the dirty little secrets.
This directory name MUST be correct for JavaScripts to work properly.

So far, the only way of a workaround is to allow long file names (set the
option in Toast, when setting up the CD). This is not necessarily critical,
as it concerns only the Windows Reader part of the CD, as long as you are
following ISO 9660 conventions with your stuff. As Reader 4 does not
support 16-bit Windoze anyway, this is acceptable.

Hope, this can help.

Max Wyss
PRODOK Engineering
Low Paper workflows, Smart documents, PDF forms
CH-8906 Bonstetten, Switzerland

Fax: +41 1 700 20 37

[ Building Bridges for Information ]


>Some guidance is requested. Lots of folk using my primer in running
>Reader v4 from CD (at PlanetPDF) have mailed me wanting to use the
>non-default setting for the Preference/General option "Open Cross-Doc
>Links in Same Window" and have been asking for guidance. Javascript seems
>to be the only (and v4 only)solution and I'm none too experienced with
>JavaScript. Can you help me help them?
>I know that if "app.openInPlace=False;" if used as a document level script
>in a PDF run in v4 it will set the option to the 'unchecked' non-default
>state at runtime (setting the flag via the menu requires an app re-start).
>As running Reader from a CD writes the viewer state to the registry, it
>will also 'reset' the state any for Acrobat/Reader v4.x installed on the
>user's h/d (as all components "share" the viewer). So, to be well behaved
>in using the above method I should cache and reset the option state when
>done with my PDF.
>I've figured out that a doc level script "varOptionState =
>app.openInPlace;" would cache the user's state prior to setting it to
>false via "app.openInPlace=False;".
>However, how do I detect the doc holding this javascript is being closed
>and run "app.openInPlace = varWinState;" to reset the option? I'm looking
>for a "before closing" sort of event if such exists.
>As you can probably see, I'm a bit out of my depth with this stuff, but
>want to help out the folk who keep asking me this question. If I get this
>procedure sorted and tested I'll write up as a PDF for all to use (with
>attribution for source of the help) and post it at PlanetPDF like my
>primer on CD/Reader.
>Any Acrobat Javascript gurus out there able to set me straight on the code
>required, or can't this be done? (Hint to Adobe - clearly plenty of
>non-pro users clearly want to do this with Reader running from CD).
>BTW, many folk, especially if authoring from the Windows platform, find
>themselves wanting/needing to use ISO9660 file/folder names. Some
>well-intentioned Acrobat programmer made all but a couple of Reader's
>files 8.3 compliant. One of the offenders is the folder \JavaScripts\.
>If this gets truncated to \JAVASC~1\ or \JAVASCRI.PTS\ will javascript
>work OK? Anyone experience this situation? Another pothole on the
>information highway...

PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Five visions of a PDF Day

In the world of PDFs or as we like to say Planet (of) PDF, a year isn't a real PDF year without an intense few days of industry knowledge sharing.

May 15, 2018
Platinum Sponsor

Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.


Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.