Saving Chrome to a PDF file

In Chrome, when you press Ctrl + P, you can select "Save to PDF." The default file name is the title of the html page that the user wants to print. Can this be changed without changing the actual name of the html page? I would like to have the date and time in the name of the PDF, but I do not need the date and time in the title of my html page.

+5
source share
2 answers

So, if you can place the print button somewhere and associate it with a function similar to the following:

function printWithSpecialFileName(){ var tempTitle = document.title; document.title = "Special File Name.pdf"; window.print(); document.title = tempTitle; } 
+10
source

This is the functionality of the print-to-PDF printer driver, and as far as I can verify, you are not in control of it. So, unfortunately, the default file name will be the page name ...

0
source

Source: https://habr.com/ru/post/1206788/


All Articles