4 Replies Latest reply on Jan 4, 2013 5:42 AM by BKBK

    Adding Text to A PDF document


      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()#



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





                                    <cffile action="read" file="d:\websites\GetHelpNow.com\www\certification\api\GetHelpNow-Certificate-#GetAuthUse r()#.pdf" variable="fileInfo">


                                    <cfheader name="Content-Type" value="pdf">

                                    <cfheader name="Content-Disposition" value="attachment;filename=GetHelpNow-Certificate.pdf">

                                    <cfcontent type="application/pdf">