Solved

Create Dynamic PDF in CF

Posted on 2002-07-29
8
2,794 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

 

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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

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…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

623 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