It is my understadning that I can create an AcroForm with variables. I use the iText Jar to assist me in reading a "template" PDF with these variables. I load these variables at run time and produce many PDF's from this. For instance, I have to generate letters that say:
"Thank You Mr. John Doe"
This works fine because my Java program can access a variabe called "UserName" and load it with "Mr. John Doe" at runtime. Cool! This is the flexibility I need and now I need to implement it elsewhere in the PDF...
-- However -- :(
Adobe hasn't come up with a solution (or they don't care) for the following (or am I crazy)?
"Thank You Mr. John Doe for your recent donation."
In fact, if my client wants a freaking period (.) after "Thank You Mr. John Doe" I can't give it to them unless I bury the period in my variable (major hack)!
The first example works (but it's a hack) because I can add a Text Box after "Thank You ". lining up this Text Box is a nightmare but eventually it will work. But, putting a Text Box in the second example just stamps the box over the existing text. In other words, it doesn't adjust itself to fit within the text.
I called Adobe and the customer service rep said Adobe has no solution for me. Now, what makes this worse is Adobe knows there's a need for this. Why you ask? Well, using Adobe' Life Cycle UI you can create a "Floating Field", which is 'almost' awesome. In the UI I can do this:
"Thank You {UserName} for your recent donation."
-- However -- :(
This is just a LifeCycle UI "thingy" that loads these values prior to generating/creating the PDF. In other words, LifeCycle tries to overcome this MASSIVE PDF deficiency but this means you can't use this functionality outside of LifeCycle (i.e., no possible way to use Java and iText to automate this).
I understand that a PDF text isn't constructed at runtime but I blame Adobe for poor architecture with this limitation. Think about it, a user says, "Can you imbed John Doe's first name in the PDF text somewhere" and I, the 'wonderful' programmer has to say, "No, that's too difficult"....Incredible.
This limitation is amazing is it not?
Trust me, I'm really not this cynical -- I'm just really disturbed with this limitation. :(
Please educate me if I am wrong.
Cheers!
George