This content has been marked as final. Show 2 replies
You can either save data to DBase and read back or populate direct.
Design a PDF form with fields using Adobe Acrobat professional, assign names to all fields, then populate same from CF as follows:
DO YOUR DATABASE QUERY. Make sure you are careful to follow field defenition and variable tags << /V(Variable) /T(Field Name) >>
This provides very robust method for populating fields in PDF form. If it hangs just remove the <CFSETTING> and <CFCONTENT> lines to check if CF is throwing an error, as PDF will just hang.
<CFSETTING enablecfoutputonly="Yes" showdebugoutput="yes">
1 0 obj
<< /V (<CFIF #GetAccident.Fatal# is 1>x</CFIF>)/T (Fatal)>>
<< /V (<CFIF #GetAccident.CMV# is 1>x</CFIF>)/T (CMV)>>
<< /V (<CFIF #GetAccident.SchoolBus# is 1>x</CFIF>)/T (SchoolBus)>>
<< /V (<CFIF #GetAccident.RailRoad# is 1>x</CFIF>)/T (RailRoad)>>
<< /V (<CFIF #GetAccident.MAB# is 1>x</CFIF>)/T (MAB)>>
<< /V (<CFIF #GetAccident.HitandRun# is 1>x</CFIF>)/T (HitAndRun)>>
<< /V (<CFIF #GetAccident.Supplement# is 1>x</CFIF>)/T (Supplement)>>
<< /V (#GetAccident.CountyName#)/T (CountyName)>>
<< /V (#GetAccident.CityName#)/T (CityName)>>
<< /V (#GetAccident.DistanceCity#)/T (DistanceCity)>>
<< /V (<CFIF #GetAccident.DirectionCity# is 'North'>x</CFIF>)/T (DirectionCity_N)>>
<</Root 1 0 R>>
You could do like Ted Daniels said and save the information into a database and then read it back into a PDF Template that you create in Acrobat/Live Cycle. I would suggest getting the information from the database and then create an XML structure. You can then populate the template with the XML structure.
The nice thing about using the XML structure is that you don't have to put the fields in the exact order and if you have extra tags in the XML structure it doesn't matter to the template because it only cares about the tags that exactly match the field names. I think it's a bit easier to understand what's going on as well. Here is an example: