Create Dynamic PDF in CF

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,
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

dash420Connect With a Mentor Commented:
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.
A good place to start looking into creating pdf's from cf is CFComet.

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.

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

Hope this sends you in the right direction.

TenTonJimAuthor Commented:
Michael these examples kick a**! Let me check it out, if it works you get the points! Thanks a lot!!!

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

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.
TenTonJimAuthor Commented:
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

the one WITH the reference to ADDIMAGE is at
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"

<cf_pdf action="startpage">

<cf_pdf action="addtext"
               text="this is a test sentence"

<cf_pdf action="addtext"
               text="this is a test bold sentence of the emergency APA Wood certificate program."
               fillcolor="0 0 1"
               outlinecolor="1 1 0"

<cf_pdf action="drawrect"
               outlinecolor="1 1 0"
               fillcolor="0 1 0">

<cf_pdf action="drawline"
               color="1 0 0">

<cf_pdf action="addlink"
               outlinecolor="0 0 1"

<cf_pdf action="ADDIMAGE"

<cf_pdf action="endpage">

<cf_pdf action="finish">

<link rel="stylesheet" type="text/css" href="../js/ie_styles.css">
<div style="margin-top:10%;padding:30px;font-size:10pt;background-color:lightyellow;color:navy;text-align:center">
<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>

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,

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...

Couldn't hurt to take a look, right?
TenTonJimAuthor Commented:
Thanks dash420 that is what I went with.
Thanks everyone!

All Courses

From novice to tech pro — start learning today.