Rud*_*dey 8 html pdf google-chrome title
在Chrome中,按Ctrl + P即可选择"保存到PDF".默认文件名等于用户要打印的html页面的标题.可以更改,而不更改HTML页面的实际标题?我希望在PDF的名称中有一个日期和时间,但我不希望在我的html页面的标题中显示日期和时间.
Con*_*sta 19
因此,如果您可以在某处放置打印按钮并将其链接到类似于以下的功能:
function printWithSpecialFileName(){
var tempTitle = document.title;
document.title = "Special File Name.pdf";
window.print();
document.title = tempTitle;
}
Run Code Online (Sandbox Code Playgroud)