Using Acrobat Pro and Javascript to make PDF

510 views Asked by At

I'm trying to work my way through the Acrobat Javascript Examples before starting on making a javascript application for it. I'm stuck on the very first example:

var newDoc = app.newDoc();

if (newDoc == "undefined")
  app.alert("Undefined NewDoc");

A new PDF Document does indeed appear, but the newDoc variable is undefined.

Below is a link to the example I'm using along with snippet of Acrobat's JavaScript Debugger I'm using. Why is the newDoc undefined?

http://help.adobe.com/livedocs/acrobat_sdk/10/Acrobat10_HTMLHelp/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Acrobat10_SDK_HTMLHelp&file=JS_Dev_Overview.71.1.html

Acrobat's JavaScript Debugger

1

There are 1 answers

0
ribald On BEST ANSWER

I got it working. You have to highlight the code you want to run before executing.