Solved

Create Dynamic PDF in CF

Posted on 2002-07-29
8
2,785 Views
Last Modified: 2013-12-24
Hello EE'ers,
Is it possible to ceate a dynamic PDF on the fly on the server and have it emailed as an attachment?

I am developing an online certification program... the client will have a template certification PDF file on the server... I will need to dynamically add the "student's" name and the courses completed onto the PDF and dynamically email a confirmation of completion as well as attach the PDF to the email... is this even possible?

Thank you,
JimS.
aka
TenTonJim
0
Comment
Question by:TenTonJim
8 Comments
 
LVL 3

Expert Comment

by:SewellM
ID: 7186669
A good place to start looking into creating pdf's from cf is CFComet.
http://www.cfcomet.com/pdf/

You can also go to the CF exchange on the macromedia site.  They have about 30 tags (some free/ some not) for use with pdf's.  
http://devex.macromedia.com/developer/gallery/SearchResults.cfm?keywords=PDF

Once it is created, just attach it to the email just as you would any attachement.

Hope this sends you in the right direction.

Michael
0
 
LVL 2

Author Comment

by:TenTonJim
ID: 7186880
Michael these examples kick a**! Let me check it out, if it works you get the points! Thanks a lot!!!

JimS.
0
 
LVL 6

Accepted Solution

by:
dash420 earned 200 total points
ID: 7187065
yah one tool called as htmldoc is available. it will convert the html page to PDF. u can download that and call the tool from cf.

http://www.easysw.com/software.html
0
 

Expert Comment

by:davidola
ID: 7203221
Yes, you can, you need to create a Form Document Format(FDF) file with the form fields and then create a similar PDF file, you will then pass the names into the formfields then to merge the FDF and the PDF file to create a dynamic full PDF page.
0
New! My Passport Wireless Pro Wi-Fi Mobile Storage

Portable wireless storage to offload, edit, and stream anywhere.

High-capacity, wireless mobile storage designed to accompany professional photographers and videographers in the field to easily offload, edit and stream captured photos and high-definition videos.

 
LVL 2

Author Comment

by:TenTonJim
ID: 7203814
OK I have found one that is allowing me to create PDF's on the fly, yet there is a bug in trying to add an image to the PDF... (won't work at all)

This client requires that it look like their *real* certificate of completion... so I need to add a huge background image... the ADDIMAGE in this code below is causing it to fail...

to see it minus the ADDIMAGE reference go to
http://apawood.org/pdfprint2/pdf4.cfm

the one WITH the reference to ADDIMAGE is at
http://apawood.org/pdfprint2/pdf5.cfm
you will see the error it generates...

the 2 pages are identical other than one is asking for an image (the image is in the same folder)

Here is the code below:
-----------------------------------------
<cf_pdf action="init"
               file="e:\InetPub\wwwroot\apawood\pdfprint2\pdfout.pdf"
               fonts="Arial|Arial,Bold">

<cf_pdf action="startpage">

<cf_pdf action="addtext"
               text="this is a test sentence"
               x="15"
               y="690"
               fontsize="48">

<cf_pdf action="addtext"
               text="this is a test bold sentence of the emergency APA Wood certificate program."
               horizscale="110"
               fillcolor="0 0 1"
               outlinecolor="1 1 0"
               x="5"
               y="650"
               fontnum="2"
               fontsize="14">

<cf_pdf action="drawrect"
               x1="0"
               y1="590"
               x2="55"
               y2="610"
               width="2"
               outlinecolor="1 1 0"
               fillcolor="0 1 0">

<cf_pdf action="drawline"
               x1="200"
               y1="580"
               x2="400"
               y2="580"
               width="1"
               color="1 0 0">

<cf_pdf action="addlink"
               x="50"
               y="560"
               href="http://www.google.com"
               width="350"
               fontsize="12"
               outlinecolor="0 0 1"
               outlinewidth="1">

<cf_pdf action="ADDIMAGE"
               x="200"
             y="100"
             filename="iconhat.gif"
             width="180"
             height="180">

<cf_pdf action="endpage">

<cf_pdf action="finish">


<html>
<head>
<title>Congratulations!</title>
<link rel="stylesheet" type="text/css" href="../js/ie_styles.css">
</head>
<body>
<div style="margin-top:10%;padding:30px;font-size:10pt;background-color:lightyellow;color:navy;text-align:center">
<h2>Congratulations!</h2>
<p>You have completed the SOMEFILE course!</p>
<p>Click <a href="pdfout.pdf">HERE</a> to print your Certificate of Completion! [Adobe PDF Format :: 10kb file]</p>
</body>
</html>
-----------------------------------------

I have not given up :) and thank you everyone for your suggestions... davidola do you have any examples of this FDF to PDF I have never heard of this technique much less know how to code it. Thanks!

Thank you,
JimS.


0
 
LVL 1

Expert Comment

by:joezizzo
ID: 7650803
hey, if you're still looking for a cf/html to pdf solution, FO might be the answer for you.  activePDF and the custom tags out there are buggy, but FO is pretty clean--just a brand of xml.  You need the FOP (formatting objects processor) from apache...
http://xml.apache.org/fop/index.html

Couldn't hurt to take a look, right?
0
 
LVL 2

Author Comment

by:TenTonJim
ID: 8422355
Thanks dash420 that is what I went with.
Thanks everyone!
JimS.
0
 
LVL 6

Expert Comment

by:dash420
ID: 8425261
Thanks

Regards,
Dash
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now