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

Create and save a .pdf file

Participant ,
Oct 06, 2010 Oct 06, 2010

Afternoon!  I am creating a pdf utilizing the cfdocument tag and it works great.  It opens and displays well.  My question is, is there a way to automatically save that generated pdf on the server without opening it?  My end goal is to run a scheduled task every week that creates and saves a pdf automatically.

535
Translate
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
Engaged ,
Oct 06, 2010 Oct 06, 2010

If you use the "name" attribute of cfdocument, the data is stored in

binary and not sent to the user. You can then just fileSave() that

puppy to the file system.

Translate
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
Guest
Oct 06, 2010 Oct 06, 2010

<cfdocument format="pdf" orientation="landscape" filename="YourPDFName.pdf" overwrite="yes">

it will save a copy of the pdf in the same folder as the <cfdocument> is run from, the problem I got is it wond display the pdf at creation time, all that is returned to my screen is the letter "z"

so may be best to fun the code in a loop and one time add in the filename and overwrite paramaters, if you dont need it displayed, then your gold.

Craig Wiseman

Translate
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
Engaged ,
Oct 06, 2010 Oct 06, 2010

Doh! idesdema - definitely use Craig's suggestion. I've used name= so

many times in the past I forgot about the filename attribute as well.

Translate
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
Participant ,
Oct 06, 2010 Oct 06, 2010

Will do.  I meant to mark his answer as Correct but pressed Useful instead.  Wups!  Wish I could change that.  Thanks Craig!!!  Works like a charm.

Translate
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
Participant ,
Oct 06, 2010 Oct 06, 2010
LATEST

All I needed to do was add the filename attribute to the tag per Craig's suggestion.

Translate
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