I have a question about defining inline variables. We are currently using overlays to print data on top of pre-defined templates. We have a tool (Tall Components) that populates the documents with data at run-time.
In Acrobat forms, it seems I am required to select a predefined area (height x width) for a variable field. Most of the forms we print are narrative legal documents they do not look like normal forms. What I would like to do is like mail merge in Word. Here is an example:
Hello $FirstName $MiddleInitial $LastName. The date today is $todaydate.
These variables will be used throughout the document but we don't want to define the field lengths because names can vary wildly in length (for example) and that would create a lot of wasted space for people with very short names. So, my question is ... is this possible in Acrobat?
So there are two approaches. The first one is to regenerate the PDF with new content using custom solution built from a 3rd party tool, like iText, ColdFusion, or any of the other PDF creation libraries/tools. I think this is what most people do.
But there is another easier possibility. Acrobat can reflow text in a multiline Text Field. Or if you use a Dynamic LiveCycle form, you can get even better reflow. Place a large text field over the area of the form (a complete paragraph) where specific strings need to be replaced. Then in code(an automation script), replace the text in the paragraph and write it into the text field. When the text replacement is complete, print the form to the PDFMaker to flatten it all out.
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script