• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Using form output to create .pdf, send .pfd as email attachment, or write form output to disk in html/cfm format

New Here ,
Feb 17, 2019 Feb 17, 2019

Copy link to clipboard

Copied

Hi, here's my problem. My web server uses CF MX 7. I want to get form output, create a .pdf from it, and send the .pdf as an email attachment. This seems to be easy using CF MX 8 and beyond: use cfdocument to create a .pdf and attach the .pdf to an email usig cfmailparam, without writing to disk first. This cannot be done in CF MX 7.

So, to accomplish what I want in CF MX 7, I need a way of doing the following:

1) Output form data to the browser. (Done)

2) Save the format to disk *in the format in which it is outputted to the browser*. (CFFILE does not help in this regard)

3) Convert the file on disk to .pdf format. (I assume CFdocument will do this.)

4) Send the .pdf file as an attachment to an email.

Is this possible? If so, how can it be achieved? Thanks very much.

Best wishes

Chris

Views

622

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 17, 2019 Feb 17, 2019

What about something along the lines of:

<!--- Here, generateFormOutput.cfm is the page that generates the form output --->

<cfdocument format="PDF" src="http://127.0.0.1:8500/workspace/CF_Project/generateFormOutput.cfm" filename="#expandPath('myDocument.pdf')#" overwrite="true" />

<cfmail from = "BKBK@localhost" To = "BKBK@localhost" Subject = "Test - Reply including PDF Attachment" username="BKBK@localhost" password="X1y2Z3">

    <cfmailparam file ="#expandPath('myDocument.pdf')#" type="applicatio

...

Votes

Translate

Translate
Community Expert ,
Feb 17, 2019 Feb 17, 2019

Copy link to clipboard

Copied

What about something along the lines of:

<!--- Here, generateFormOutput.cfm is the page that generates the form output --->

<cfdocument format="PDF" src="http://127.0.0.1:8500/workspace/CF_Project/generateFormOutput.cfm" filename="#expandPath('myDocument.pdf')#" overwrite="true" />

<cfmail from = "BKBK@localhost" To = "BKBK@localhost" Subject = "Test - Reply including PDF Attachment" username="BKBK@localhost" password="X1y2Z3">

    <cfmailparam file ="#expandPath('myDocument.pdf')#" type="application/pdf">

    Reply, bla bla bla

</cfmail>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 17, 2019 Feb 17, 2019

Copy link to clipboard

Copied

LATEST

Check out webkit, which Adobe leveraged under the covers in cf11 as a new alternative to cfdocument (a new tag called cfhtmltopdf). If you Google about, you'll find you can implement the webkit engine yourself and call it from cfml--as people have also called it from php,. Net, etcI can offer more than that general pointer, though. /CharlieSent via the Samsung Galaxy S7 active, an AT&T 4G LTE smartphone


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation