Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do I create a Dynamic PDF in ColdFusion

Posted on 2009-07-10
8
Medium Priority
?
532 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 1500 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
Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

 
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

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

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

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

609 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