Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving Dynamic Page to PDF

Status
Not open for further replies.

yoshismokey

Programmer
Sep 17, 2005
25
0
0
US
Hi,
Thanks to this forum, I was able to learn how to use the cfsavecontent tag to capture a dynamic cf page and display it. I was also able to send it via email as html. Is there a way I can save the output from a cfsavecontent to a pdf file?

Here's the code I have for the html:


<cfsavecontent variable="savesummary">
<html>
code for page here...
</html>
</cfsavecontent>
<cfoutput>Your summary has been sent successfully</cfoutput>
<cfoutput>#savesummary#
<cfmail
from="test@test.com"
server="smtp.patmedia.net"
subject="UPR Final Submit"
to="test@test.com"
>
#savesummary#
</cfmail>
</cfoutput>


Thanks in advance.
 
Hi,
Thanks for the info.
So far I have the folowing code which gives me a pdf page with the message "Connection failure" on it.


<cfdocument format="pdf" filename="C:\UPRSummary.pdf" pagetype="a4" margintop="0.1" overwrite="yes">
<cfoutput>#savesummary#</cfoutput>
</cfdocument>
<cfoutput>
<cfhttp method="put" url="c:\UPRSummary.pdf">
<cfdocument format="pdf">
<cfdocumentitem type="header">
<cfoutput>Your Summary has been sent successfully</cfoutput>
</cfdocumentitem>
<!--- Display the page --->
#cfhttp.filecontent#
</cfdocument>
</cfoutput>



Any suggestions?
Thanks again!![bigears]
 
you can't use the <CFHTTP> to connect to your C: drive, it has to be a sever HTTP URL. CF defaults to http:// if none is specified. Instead of doing "c:\UPRSummary.pdf" do " (i'm assuming that the UPRSummary.pdf is saved on the server)

____________________________________
Just Imagine.
 
That's the problem that I'm having. I can't figure out how to save the PDF to a file. This is the code that I am using now:
<cfsavecontent variable="savesummary">
my html here...
</cfsavecontent>
<cfdocument format="pdf" pagetype="a4" margintop="0.1">
<cfdocumentitem type="header">
<cfoutput>Your Summary has been sent successfully</cfoutput>
</cfdocumentitem>
<cfoutput>#savesummary#</cfoutput>
</cfdocument>

This code displays the pdf very nicely on the screen for the user. But I need it to be saved so I can email it as an attachment.

Thanks again for your help.
 
Thanks! Here is the code that ended up working for me:
<cfsavecontent variable="savesummary">
html code here...
</cfsavecontent>

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

<cfmail
from="test@test.com"
server="smtp.exit109.com"
subject="UPR Final Approval Test"
to="test@test.com"
>

<cfmailparam file=" type="application/pdf">
</cfmail>

Thanks again for your help![bigsmile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top