George,
Here's the basic idea in a nutshell that we've used successfully.
--- You need a real working version of Adobe Acrobat (not necessarily on
the server, just on your desktop where you're working).
Instead of creating the usual pdf file. create that file as what THEY
call a 'form'ie Adobe lets you create areas on the page that are
substituted with variable values.
I don't remember the details of how you create this but what you end up
with is a PDF file that's your printable document with variables as
placeholders... and then an FDF file that has the data values for each
of the variables.
Essentially it's the same concept as how you would think of mail-merge in a
word-processing program. One file to hold the document (w/ variables
placeholders) and another file to hold the data that needs to be
mail-merged into the document.
--- Now all you need your CF code to do is create the FDF file on-the-fly!
This is not hard to do because if you've generated the fdf file already
using Adobe, just open it up in any ascii editor and see what makes it tick.
There's all kinds of hex crap on top you just copy AS-IS, followed by a
series of lines for all the variables and their values (which you generate
as appropriate), followed by a very important line that indicates to the
fdf file where its mate the 'pdf' file is actually located on the SERVER,
followed by some closing lines that you copy AS-IS.
After you've dynamically created the fdf file on the server, you actually
go directly to it with a CFLOCATION, and the fdf file will find its mate
(the pdf file) and do the merge.
Then your browser will be looking at the fully-merged pdf file and be ready
for all the usual pdf activities (view, print).
Caveats:
-- the variable names are case-sensitive. be sure to spell them EXACTLY
the same way in your generated fdf file as the pdf file is expecting them.
-- the line in the fdf file where you identify WHERE the pdf file is
located... when you first look at your Adobe-generated fdf file this is
going to be a regular pathname/filename on your hard drive, but since
you're doing this work really from a browser-request, you have to change
this to be an http reference to the pdf file
IE use: http://www.yoursite.com/holdfiles/xxx.pdf
NOT c:\inetpub\wwwroot\yoursite\holdfiles\xxx.pdf
hth,
Tobe Goldfinger
jdt technologies, ltd.
921 Peninsula Blvd
Woodmere, NY 11598
516-569-5606
800-252-5519
* Allaire Alliance Consulting Partner
* Co-Manager NY ColdFusion User's Group
At 04:59 PM 6/19/2001 , you wrote:
Hi,
I want draw some data from database with CF, and then put the data to PDF
file, is this possible?
If anyone can help me, I will very appreciate.
thanks.
~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists