Solved

How do I create a Dynamic PDF in ColdFusion

Posted on 2009-07-10
8
512 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Server with multiple sites and SSL 14 62
assigning port numbers to web sites and web services 2 70
htaccess restrict subdomain 4 84
Moving web servers into a DMZ? 3 46
This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
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…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

947 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

18 Experts available now in Live!

Get 1:1 Help Now