Solved

Create Dynamic PDF in CF

Posted on 2002-07-29
8
2,784 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
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Suggested Solutions

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

760 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

19 Experts available now in Live!

Get 1:1 Help Now