Solved

How do I create a Dynamic PDF in ColdFusion

Posted on 2009-07-10
8
516 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
[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
  • 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
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

687 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