Saturday, June 9, 2007

Populating a PDF form with XML data

Coldfusion 8 allows you to populate a pdf form with the xml data(read from a xml file).

Example: Consider a pdf form say, "payslipTemplate.pdf" is to be filled with employee data. The data is present in a xml file, formdata.xml

cfset sourcefile = "#ExpandPath('payslipTemplate.pdf')#"
cfset destinationfile = "#ExpandPath('employeeid123.pdf')#"
cfset datafile = "#ExpandPath('formdata.xml')#"

cfpdfform source="#sourcefile#" destination="#destinationfile#" action="populate" xmldata="#datafile#"

Done...

4 comments:

Javi said...

Ahamad,

Great post and thanks for sharing! I've been doing this on a project here at work but we are running into an issue. We are wondering if their is a limitation on the cfpdf tag.

For example, you are just populating one PDF form but we need to populate multiple ones and then merge them together. Everything works fine in the individual populating but when the populated PDFs are merged you don't see the fields populated anymore. Is this possible currently with cfpdf?

Anonymous said...

Hellо! Dо you κnοw if they
make any plugins tο assіst ωith Ѕеaгch
Engіne Optimіzаtiοn?
I'm trying to get my blog to rank for some targeted keywords but I'm
not seеing vеry good rеsults.
If you know of any plеaѕе shaге.
Mаny thankѕ!

Vіѕit mу weblog - asker oyunları

Anonymous said...

Hello! Do you knoω if theу maκe
аnу ρluginѕ to asѕіst with Ѕearch Еngine Optіmіzаtion?
I'm trying to get my blog to rank for some targeted keywords but I'm not ѕeеing veгу good results.
If you knοω of аny pleаse share. Many thanks!



Аlso νisit my pagе: asker oyunları

Anonymous said...

Hi. This service here allows you to easily edit your PDF documents.
http://goo.gl/jNumkS

You can fill out PDF form, save it, fax it, and email it.