Skip to main content
Known Participant
September 5, 2016
Question

Javascript to print to current directory with date stamp

  • September 5, 2016
  • 5 replies
  • 1054 views

Need to setup a button that prints the document, to the current directory with a specific phrase (name) and a date stamp. Do not need user interaction. 

Example: importantstuff_9-5-2016.pdf.

(also, just thinking, will never need it, but could someone also lend some insight on error checking to see if the "doc" already exists - and if so incrementing the stamp? Example: importantstuff_9-5-2016a.pdf)

(thanks in advance you guys are great!)

This topic is closed to new replies. Start a new post to keep the conversation going.

5 replies

try67
Community Expert
Community Expert
September 5, 2016

You can't use a script to print to a file and specify the file name. You can send it to the Adobe PDF printer (assuming that's what you mean), but the user will have to manually specify the file name. You can, however, save the file under a different name (but this required a script to be installed on the user's local machine).

HambergAuthor
Known Participant
September 5, 2016
  1. Yes to printing to the PDF Printer.
  2. This is for my use and automation - so I can store the script
  3. Reading the documentation and thought there may be a parameter to the Print method that would allow naming the file and possibly pulling a piece of the current directory for that and adding the current date?
try67
Community Expert
Community Expert
September 5, 2016

Nope, not possible. Why do you need to "re-fry" the file (ie, send it to the PDF printer)? Generally speaking, it's not a good idea.