Skip to main content
October 6, 2010
Question

Create and save a .pdf file

  • October 6, 2010
  • 3 replies
  • 617 views

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.

    This topic has been closed for replies.

    3 replies

    October 6, 2010

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

    October 6, 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

    cfjedimaster
    Inspiring
    October 6, 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.

    October 6, 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.

    cfjedimaster
    Inspiring
    October 6, 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.