1 Reply Latest reply on Oct 17, 2007 8:45 AM by proximo

    save a dyn pdf when submit

    indranie

      Hi,

      I have an application where a user fill in a form, then they click on ‘preview’ and the form user (using camped tag) create a dynamic PDF file. (The puff is open in its own window outside of the form)… the PDF is for viewing purpose only.)

      After the user view the pdf, if it’s ok.. they click submit (send info) on the form to send the form information to client.

      What I want is when the user click submit (send info) I want to SAVE the PDF file as well. And attached it to the email that goes to the client.

      I’m stuck on how to do this. Any assistance is greatly appreciated!
        • 1. Re: save a dyn pdf when submit
          proximo
          What you do is use the CFFile to save the PDF to the server HD and then attach it to an email and using cfmail and it should send out just fine.

          It should look somthing like this

          <cfdocument format="pdf" filename="pathtopdf.pdf" overwrite="yes">
          whats going to be in the PDF etc
          </cfdocument>
          <Cfmail to="emailto" from="emailfrom" subject="mail test" server="localhost" username="username" password="pass">
          This document is a pdf of the email that was sent
          <cfsilent>
          <cfmailparam file="where the pdf was saved">
          </cfsilent>
          </Cfmail>
          <Cfmail to="emailto" from="emailfrom" subject="mail test" server="localhost" username="username" password="pass">
          This is your copy
          <cfsilent>
          <cfmailparam file="pathtopdf">
          </cfsilent>
          </Cfmail>

          now if you want you can also use the cffile to delete it from the server or keep a copy as well.

          Hope this helps.