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) Beginners

Topic: Overflow text to a template-generated page
Conf: (P-PDF) Beginners, Msg: 159477
From: kaelen
Date: 4/11/2007 01:52 AM

This one's been driving me crazy for several days now:

I really wish Acrobat simply had the ability to link fields, like MS Publisher does with a click of the mouse! That's what I'm trying to recreate, and I feel like I'm attempting to reinvent the wheel. As you will probably be able to tell from my scripting below, I am very far from being an experienced programmer. I really hope someone can help me with this.

I am trying to create a form in Acrobat Pro 6.0.6 that will generate as many continuation pages as needed from a template. A custom keystroke script in a multi-line narrative text field uses event.fieldFull to spawn the new page and applies the values of certain fields from the first page to the appropriate fields on the new one, then gives the narrative field on the new page the focus. Here are my issues:

1. The script on the first page narrative field worked in Acrobat 6.0, then I ran updates to 6.0.6 and now when I run the script, Acrobat encounters "a problem and needs to close". Event Viewer shows Event ID 1000, Source Application Error, with the following Description:

"Faulting application acrobat.exe, version, faulting module acroform.api, version, fault address 0x000aae98."

I can't figure out why it does this, beyond a fundamental change in how Acrobat handles JavaScript.

2. The script on the template has to account for changing field names, i.e. “Page#_.template_name.original_field_name”. I was getting errors in the Debugger saying that “Defendant has no properties”

3. I would like to capture the final keystroke that triggers the spawning of the new page and make it the first keystroke in the narrative field of the new page, so the user doesn't have to re-type it

4. If possible, I would like the user to be able to arrow up and down between the narrative fields, as if it's all one field (my instructions are to make it as "dummy-proof" as possible)

Here are my scripts:

Page 1 custom keystroke script on the narrative field:

if ( event.fieldFull )
var expTplt = getTemplate("Page2");
var Defendant = getField("P1.Page2.Def2")
Defendant.value = getField("DefName").value;
var Num = getField("P1.Page2.RptNum2")
Num.value = getField("RptNum").value;
var NumAdd = getField("P1.Page2.RptNumAdd2")
NumAdd.value = getField("RptNumAdd").value;
var Focus = getField("P1.Page2.Narr2")
Focus.value = event.change;

The same, on the template for further page spawning:

this.disclosed = true 'for some reason it wouldn't do anything until I added this'
if ( event.fieldFull )
var lastkey = event.change.value
var expTplt = getTemplate("Page2");
var nextPg = "P" + ++this.pageNum;
var Defendant = getField(nextPg.Page2.Def2);
Defendant.value = getField("DefName").value;
var Num = getField(nextPg.Page2.RptNum2);
Num.value = getField("RptNum").value;
var NumAdd = getField(nextPg.Page2.RptNumAdd2);
NumAdd.value = getField("RptNumAdd").value;
var Focus = getField(nextPg.Page2.Narr2);
nextPg.Page2.Narr2.value = lastkey.value

Help me, please!

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.