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)
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
See example from Ray's site @
https://www.raymondcamden.com/2014/02/06/Some-tips-for-working-with-PDF-Forms-and-ColdFusion/
https://www.raymondcamden.com/2014/02/06/Some-tips-for-working-with-PDF-Forms-and-ColdFusion/
ASKER
And therein lies my particular problem. Have never used the cfdocument tag until now, so not sure what is needed in coding.
ASKER
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.
ASKER
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#</c foutput>
</cfdocument>
<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#</c
</cfdocument>
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.