Populate PDF Document with data - Coldfusion 11

Hi All,

I have a pre-printed statement in PDF document. I want to populate this PDF document with data from a data source
and email this populated PDF Document to the Client. How can I do this in Coldfusion? Please advise. Errol
Errol FarroAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

_agx_Commented:
Assuming what you have is a pdf "form", you can use cfpdf to to populate the form values.  (Use action="read" to get field names) Then email the populated form with cfmail.

Something along these lines:

<!--- populate form fields (need to know form field names first) --->
<cfpdfform source="c:\pathTo\inputFile.pdf" destination="c:\pathTo\OutputFileName.pdf" action="populate"> 
        <cfpdfformparam name="someFieldName" value="AAA"> 
        <cfpdfformparam name="otherFieldName" value="BBB"> 
        ... other fields
</cfpdfform>

<!--- email form fields --->
<cfmail ...>
  ...
   <cfmailparam file="c:\pathTo\OutputFileName.pdf" remove="yes">
</cfmail>

Open in new window

Errol FarroAuthor Commented:
Thx agx. How do I create a PDF form. Do I need Adobe professional for this? Thx.
_agx_Commented:
Yes, Pro is one of the more commonly used tools. Though I'm sure there are other alternatives out there as well.  

I don't know if this still holds true for CF11, but there used to be some differences between the 2 form types:  Acrobat and LiveCycle.  You can populate either form type with cfpdfform, but only Acrobat forms could be flattened (ie made non-editable).

... Flattening forms created in Acrobat
You use the cfpdf tag to flatten forms created in Acrobat. ColdFusion does not support flattening forms created in LiveCycle. For more information, see Assembling PDF Documents in the Developing ColdFusion Applications.
_agx_Commented:
>  you can use cfpdf to to populate the form values.

Oops.  I meant to type cfpdfform there. Sorry, my bad.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.