Tips & Tricks

Accessing the Acrobat Doc Object in LiveCycle Designer

February 15, 2005


Users thinking of moving their PDF forms over to Adobe LiveCycle Designer need to realize that there are some fundamental differences between forms created via Adobe Acrobat and those created with Designer. The underlying difference is the fact that forms created with Designer are based on the Adobe XML Form Object Model, which is differs from the Document Object Model (DOM) of those created via Acrobat.

Note: More information on the Adobe XML Form Object Model can be found in the reference document at Adobe's site.

So what about all the JavaScript code you may have written in the past to enhance your PDFs? Can that still be used in Designer, or do you have to learn all new ways of doing things? Well there's some good news there, as you should find that all the objects (i.e. App, Console, Util, etc.) found in the Acrobat JavaScript Reference document will work in forms created in Designer. There's one exception to this, and that is when you're wanting to access the Acrobat Doc object.

Accessing the Doc object

To write against the Doc object you first need to retrieve it using the following piece of code.

	var objDoc =;

This stores the Doc object in the objDoc variable, which can now be used to write code against the Doc object. This example accesses the PDF's Doc object and sets the document zoom level to 75%.

	var objDoc =;
	objDoc.zoom = 75;

Accessing the other objects

No special tricks are required for accessing the objects besides the Doc object, just write your code as though you were doing it in Acrobat. For example, to check what version of Acrobat/Reader the user is running and write it to the Acrobat console you would just use the normal code:

	var version = app.viewerVariation + " " + app.viewerVersion;
	console.println("The user is running " + version);

More Info

PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Quick PDF Library

Get products to market faster with this amazing PDF developer SDK. Over 900 functions and an equally...

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.