Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

print to file: print always to same directory based on DOMAIN (URL), file naming macros

  • 2 replies
  • 1 has this problem
  • 2 views
  • Last reply by reikred

more options

When I print a page to a file I generally want the pdf file to end up in a specific directory that depends on the domain name portion of the URL. There does not seem to be a setting to accomplish this.

Something similar already exists for downloads, namely the config variable browser.download.lastDir.savePerSite = TRUE. What I need is a similar functionality, with a config variable to control it, but for pdf printing, (maybe it should be called print.print_to_filename.savePerSite or something along those lines).

ALSO: Additionally, provide macros for DOMAIN, URL, BASENAME, DATE (yyyy-mm-dd format) and TIME (hh-mm-ss) format to construct filenames automatically according to user choice. Something like being able to define

print.print_to_filename.default_file_name = "%DOMAIN%.%BASENAME%.%DATE%.%TIME%.pdf"

When I print a page to a file I generally want the pdf file to end up in a specific directory that depends on the domain name portion of the URL. There does not seem to be a setting to accomplish this. Something similar already exists for downloads, namely the config variable browser.download.lastDir.savePerSite = TRUE. What I need is a similar functionality, with a config variable to control it, but for pdf printing, (maybe it should be called print.print_to_filename.savePerSite or something along those lines). ALSO: Additionally, provide macros for DOMAIN, URL, BASENAME, DATE (yyyy-mm-dd format) and TIME (hh-mm-ss) format to construct filenames automatically according to user choice. Something like being able to define print.print_to_filename.default_file_name = "%DOMAIN%.%BASENAME%.%DATE%.%TIME%.pdf"

All Replies (2)

more options

This support site doesn't make a good suggestion box, but we can toss around ideas for fun.

It might be possible to integrate this with the SaveAsPDF() method extensions can use (on Linux and Windows; not available on Mac).

Regarding the path, it is simple to get the full host name, but is there a good solution for getting just the domain name portion? Considering the diversity of domains in the world, it could get tricky.

Anyway, to submit suggestions for future Firefox features, you could use one or more of the following (depending on whether you want a suggestion box or a discussion):

more options

Ok, many thanks for the advice, I have posted on reddit and to Feedback (does anyone ever read Feedback? :-)).

https://www.reddit.com/r/firefox/comments/92f68a/print_to_file_print_always_to_same_directory/

Modified by reikred