Solved

How do I create a Dynamic PDF in ColdFusion

Posted on 2009-07-10
8
511 Views
Last Modified: 2013-12-24
I am using ColdFusion CS4 and I need to create a dynamic PDF certificate for the user when they finish a short test.
Their name is in a session var and should dynamically enter in to the Name field of the certificate as well as the date.
The user can print The PDF certificate, which must be protected to Allow Print only.
I have a PDF created in Adobe Lifecycle Designer. This contains all the data and a text field Name and Data that needs the dynamic input from ColdFusion.
Can anyone help on this? Even if it is a tag or 3rd party app that I could use.
0
Comment
Question by:john_hollings
  • 5
  • 3
8 Comments
 
LVL 13

Expert Comment

by:srikanthmadishetti
ID: 24822101
NO need for third party to create pdf in coldfusion.

<cfoutput>
<cfsavecontent  variable ="pdfcontent">


<table width=100%>
<tr>
<td>
#session.name#  scored #points# points in the test.
</td>
</tr>
<tr>
 <td>
 on #Dateformat(now(),"mm/dd/yyyy"))#
 </td>
 </tr>
<tr>
 <td>
 what ever other data you want to print
 </td>
 </tr>
</cfsavecontent>


<cfdocument format="pdf">
#pdfcontent#

</cfdocument>

</cfoutput>


0
 
LVL 13

Accepted Solution

by:
srikanthmadishetti earned 500 total points
ID: 24822104
<cfoutput>
<cfsavecontent  variable ="pdfcontent">


<table width=100%>
<tr>
<td>
#session.name#  scored #points# points in the test.
</td>
</tr>
<tr>
 <td>
 on #Dateformat(now(),"mm/dd/yyyy"))#
 </td>
 </tr>
<tr>
 <td>
 what ever other data you want to print
 </td>
 </tr>
</table> - forgot this in previous comment
</cfsavecontent>


<cfdocument format="pdf">
#pdfcontent#

</cfdocument>

</cfoutput>
0
 
LVL 5

Author Comment

by:john_hollings
ID: 24822419
Boy, I have been working on this a a week or two, thanks. With code I just don't understand...
<cfpdfform action="populate" source="helpdesk.pdf">
      <cfpdfsubform name="form1">
            <cfpdfsubform name="page1">
                  <cfpdfformparam name="employeeName" value="John Hollings" />
                  <cfpdfformparam name="date" value="#dateformat(now(), 'dd mmmm, yyyy')#" />
                  <cfpdfformparam name="department" value="ColdFusion Product Team" />
                  <cfpdfformparam name="jobtitle" value="ColdFusion Specialist" />
                  <cfpdfformparam name="email" value="adlehman@adobe.com" />
                  <cfpdfformparam name="phone" value="(240) 350-7803" />
                  <cfpdfformparam name="submitURL" value="#CGI.SCRIPT_NAME#" />
                  </cfpdfsubform>
      </cfpdfsubform>
</cfpdfform>

When I run this I can copy and paste data, is there a way to lock down the PDF so only printing can operate...
No Copy of data
No Saving the file
Only print and close

May be I dreaming, but if that could be accomplished I would be over the moon.
0
 
LVL 13

Expert Comment

by:srikanthmadishetti
ID: 24822494
oops srry i think i mistook the question in a different way .

I am  not so much familliar with cfpdfsubform  .

Sorry for that .


0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 5

Author Comment

by:john_hollings
ID: 24822660
No, the cfpdfsubform is what I have done and not very well.

Your code works fine, but how can I lock down the PDF so only printing can be performed by the user?
No Copy of data
Only print and close
0
 
LVL 13

Expert Comment

by:srikanthmadishetti
ID: 24825474
I think you can't do this cfdocument you need to use some third party .

Try to use easypdf or cf_pdf .


<input id="gwProxy" type="hidden"><!--Session data--><input onclick="jsCall();" id="jsProxy" type="hidden">
0
 
LVL 13

Expert Comment

by:srikanthmadishetti
ID: 24825481
ignore this statement :
<input id="gwProxy" type="hidden"><!--Session data--><input onclick="jsCall();" id="jsProxy" type="hidden">
0
 
LVL 5

Author Closing Comment

by:john_hollings
ID: 31602008
I have awarded the point, as your answer has given me a work around
Thanks
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 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