Link to home
Start Free TrialLog in
Avatar of cpwilson
cpwilson

asked on

Create pdf using coldfusion and save to server for later retrieval

I have a form that is completed online that now needs to be generated as a saved pdf file in a folder on the server. The name and location for the pdf would then be emailed to someone for them to retrieve for viewing. As an aside, would also need to know best way to have a signature placed into the pdf when created (I realize this is 2 questions in 1. 1st one more important for now)
Avatar of Pravin Asar
Pravin Asar
Flag of United States of America image

Essentially you are looking forward to setting up Workflow.

Anyway, pdf at server is created in some directory. Either by the way of unique file naming you can associate a file with user, time if creation. You may save the file path and users info, time, description, etc. In some data table for later retrieval  and/or send link to his email.
Also not sure, yiu want to save PDF at server.

So far applying signature look at CFDOCUMENT tag attributes.
Avatar of cpwilson
cpwilson

ASKER

What I think I am actually looking for is to be able to create a from what they enter into the form then when the form contents are submitted be able to email it as a pdf
ASKER CERTIFIED SOLUTION
Avatar of Pravin Asar
Pravin Asar
Flag of United States of America 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
And therein lies my particular problem. Have never used the cfdocument tag until now, so not sure what is needed in coding.
OK, think I have solved the problem of creating the pdf and storing it. Seem to be having a problem with the email portion but trying to work through it. Will award you the points for your time, effort and assist.
this is the code I ended up with that works

<cfsavecontent variable="savesummary">

<cfoutput>
 

        <cfloop query="myQuery">
 data from query
        </cfloop>
</cfoutput>
</cfsavecontent>

<cfdocument format="pdf" filename=filename.pdf" pagetype="a4" overwrite="yes">
<cfdocumentitem type="header">
  <cfoutput>Your Summary has been sent successfully</cfoutput>
</cfdocumentitem>
<!--- Display the page --->
<cfoutput>#savesummary#</cfoutput>
</cfdocument>