Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
<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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
All I needed to do was add the filename attribute to the tag per Craig's suggestion.