Copy link to clipboard
Copied
My old code would print a certificate for a user once they pass a test stored in an Access Database. Once the provider upgrade to CF10 the cf_pdf changes to cfpdf and then that is where i get lost. This code no longer works and I do not know where to start to make this work. Any suggestion would be helpful. Once I change the tags to cfpdf, then I get more errors such as DDX which is new to me.
--------------------
<cfif GetAuthUser() is not "">
<cfquery datasource="GetHelpNow" name="Get">
SELECT * FROM Users WHERE user_id = #GetAuthUser()#
</cfquery>
<cfif (Get.recordcount is not 0) and (Get.user_certFailures is 0) and (Get.user_certCompleted is 1)>
<cf_pdf file="GetHelpNow-Certificate-#GetAuthUser()#.pdf">
<cf_pdf_info file="Cert.pdf">
<cfloop query="request.PDFInfo">
<cf_pdf_page width="#width#" height="#height#">
<cf_pdf_read file="Cert.pdf" page="1" />
<cf_pdf_text x="360" y="396" rotate="90" align="center" font="Arial" size="20" color="000000" bold="true"><cfoutput>#Get.user_fname# #Get.user_lname#</cfoutput></cf_pdf_text>
<cf_pdf_text x="432" y="396" rotate="90" align="center" font="Arial" size="16" color="FFFFFF" bold="true"><cfoutput>#DateFormat(Get.user_certCompletedDate, "m/d/yyyy")#</cfoutput></cf_pdf_text>
</cf_pdf_page>
</cfloop>
</cf_pdf>
<cffile action="read" file="d:\websites\GetHelpNow.com\www\certification\api\GetHelpNow-Certificate-#GetAuthUser()#.pdf" variable="fileInfo">
<cfheader name="Content-Type" value="pdf">
<cfheader name="Content-Disposition" value="attachment;filename=GetHelpNow-Certificate.pdf">
<cfcontent type="application/pdf">
<cfoutput>#fileInfo#</cfoutput>
</cfif>
</cfif>
--------------------
thanks
Copy link to clipboard
Copied
cf_pdf is obviously a custom tag. If it no longer works you have two choices. You can try to make it work or you can abandon it and use cfpdf.
Copy link to clipboard
Copied
I will abondon it, can you point me to an example
Copy link to clipboard
Copied
Marine71 wrote:
I will abondon it, can you point me to an example
That seems a hasty decision. As Dan has said, cf_pdf is a custom tag, hence a developer's tag. As such, it practically hs nothing to do with ColdFusion's own tag, cfpdf.
Reverse all the changes you made, returning the code to its original state. The existence of a custom tag, cf_pdf, implies the existence of a file named pdf.cfm, which contains the basic code. Copy that file to the same directory as the CFM file containing the code you've shown above. Now, run the original version of the above code.
Copy link to clipboard
Copied
Oh, something else. Alternative places to look for the file, pdf.cfm (besides the current directory), are: