Tips & Tricks

Accessing the Acrobat Doc Object in LiveCycle Designer

February 15, 2005

Advertisement
Advertisement
 

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 = event.target;

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 = event.target;
	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

Related Products at PDF Store

PDFlib TET

Reliably extract text from any PDF file with this library/component. TET makes available the text co... View full product details
Download free demo

Nitro PDF Professional

Nitro PDF Professional, your PDF creation and editing product. Priced at $99, Nitro PDF Pro is the m... View full product details
Download free demo

ARTS PDF Aerialist

Take Acrobat to the next level with advanced splitting and merging; flexible bookmark creation and m... View full product details
Download free demo

PDF In-Depth Free Product Trials Ubiquitous PDF

Nitro PDF Professional

the perfect PDF product for business and enterprise, combining an extremely competitive price with a...

Download free demo

XpdfViewer

This ActiveX control (OCX) provides a PDF file viewer component, enabling developers to add PDF viewing...

Download free demo

Ubiquitous PDF: PDF eBooks-Library

If you are looking for a good store of PDF content, you could do a lot worse than visiting eBooks-Library.com...

September 03, 2009
Search Planet PDF
more searching options...







Download PDF Creator

Download The Best of Planet PDF volume 2
Planet PDF Newsletter
Most Popluar Articles
Features

Collating PDFs using JavaScript

Despite the numerous benefits, there can be potential issues with the conversion of paper documents into electronic archives. When scanning paper pages into PDF, it's possible to end up with the odd- and even-numbered pages in separate PDF files. It can be very time-consuming to collate them manually, but there is an easier way. Sean Stewart explains.

Featured Product

BCL easyPDF SDK

BCL easyPDF SDK is a set of PDF Programming Libraries designed specifically to help Software Developers / Programmers build and deploy enterprise class PDF applications for corporate wide PDF...

Platinum Sponsor
Create & Edit PDF - Nitro PDF Software

ARTS PDF

Silver Sponsors

PDF-Tools enfocus

QuickPDF: The Unrivaled PDF Developer Toolkit