> I'm having a bit of confusion about this PDF thread that has been going
back
> and forth the last few weeks and I'm not sure where the good advice
recently
> posted actually points.
>
> Here is what I want to do:
>
> 1) dynamically fill in data from a DB to a PDF file, using CF.
> 2) how to create that PDF file ahead of time (NOT on-the-fly!)


I have not tested the Adobe FDF ActiveX .... aka Adobe FDF Toolkit under
heavy loads, but its seems to work ok so far.

http://partners.adobe.com/asn/developer/acrosdk/forms.html

http://partners.adobe.com/asn/developer/acrosdk/DOCS/fdftkref.pdf

Here's what we're doing with forms - so far .....
[kudos to Aymeric Grassart - of course]


1. Create your PDF document/form distill it/pdfwriter driver from word
etc.....

2. Draw the "to be filled in form fields" on your pdf doc/form and assign
them properties
using the Adobe Acrobat full version form tool.  There are other methods
that are kinda
interesting too - like scanning the doc from OmniForm4 and saving as a PDF
:-)

3. Inside Adobe Acrobat - full version - export FDF data (blank form data)
to an FDF file on the webserver.  This fdf will be used later as a
"template" FDF to be modified / filled in in your process.....
[myFirstFDF.fdf]

4. Use <CFOBJECT> to call the tools in the FDF Toolkit activeX to pump data
into your
your PDf Form/file from steps 1&2 above.

See real simple example below:

<!--- Instantiate an FDF ActiveX object on webserver --->
     <cfobject type="COM"
         action="create"
         class="FdfApp.FdfApp"
         name="objFdf">


 <!--- Tell the object which fdf to modify --->
 <cfset theFDF =
objFdf.FDFOpenFromFile("q:\yourFiles\fdfDir\myFirstFDF.fdf")>

 <!--- Set all of the form fields with their appropriate values. --->


<cfscript>
    myFDF1 = theFDF.FDFSetValue ("fdfField1",   "#CFQuery1#",  "false");
    myFDF2 = theFDF.FDFSetValue ("fdfField2",    "#CFQuery2#",  "false");
    myFDF3 = theFDF.FDFSetValue ("fdfField3",    "#CFQuery3#",  "false");
</cfscript>



 <!--- set the "PDF" file location to be used to DISPLAY the field
data. --->
 <cfset setfile =
theFDF.FDFSetFile("http://192.168.1.100/pdfForms/mySimple.pdf")>


<!--- Save the new Fdf to the webserver --->
<cfset tmp = theFDF.FDFSaveToFile("q:\yourFiles\fdfDir\myFirstFDF.fdf")>

<!--- you'll likely need to develop a clever random "fdf" file naming scheme
of some sort
         as the toolkit doesnt deal with that - and will overwrite your
other fdf data --->

  <!--- Save FDF values to str var --->
 <!--- <cfset savestr = theFDF.FDFSaveToStr()> --->
 <!--- theres discussion that you can launch the data display in the pdf
form from a
          memory buffer - using the FDFSaveToString() without the above
write to the file system
          but I have yet to figure that out --->

 <!--- Close the theFDF object --->
 <cfset closedf = theFDF.FDFClose()>

 <!--- Free the objFDF object --->
 <cfset objFDF = "">

 <!--- Now, display the form filled with this fdf's data - 2 options --->

 <!--- Using cflocation method --->
 <CFLOCATION URL="http://www.yourserver.com/fdftemp/myFirst.fdf">


 <!--- Using CFCONTENT method --->
 <cfcontent type="application/vnd.fdf"
      file="q:\yourFiles\fdfDir\myFirstFDF.fdf">


------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to