Link to home
Start Free TrialLog in
Avatar of john_hollings
john_hollingsFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How do I create a Dynamic PDF in ColdFusion

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.
Avatar of SRIKANTH MADISHETTI
SRIKANTH MADISHETTI
Flag of India image

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>


ASKER CERTIFIED SOLUTION
Avatar of SRIKANTH MADISHETTI
SRIKANTH MADISHETTI
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of john_hollings

ASKER

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.
oops srry i think i mistook the question in a different way .

I am  not so much familliar with cfpdfsubform  .

Sorry for that .


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
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">
ignore this statement :
<input id="gwProxy" type="hidden"><!--Session data--><input onclick="jsCall();" id="jsProxy" type="hidden">
I have awarded the point, as your answer has given me a work around
Thanks