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: JavaScript - using 'openInPlace'
Conf: (P-PDF) Developers, Msg: 54413
From: mwra
Date: 5/29/2002 05:05 PM


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...

Regards to all,

Mark Anderson

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.