Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a custom file name for a file while saving the print page?

Here i am printing a page through window.print() event and before printing i need to save this page for that i need to hardcore a file name in this event.

   <a href="_javascript:window.print()">
    <img class="noPrint" src="Images/Print_icon.png" border="0"></a>

Any suggestion?

like image 596
Rooney Avatar asked Apr 17 '12 10:04

Rooney


1 Answers

You can change the title via document.title:

<a href="someRealUrl" onclick="document.title='My new title'; window.print(); return false;"><img class="noPrint" src="Images/Print_icon.png" border="0"></a>
like image 151
Tim Schmelter Avatar answered Oct 28 '22 13:10

Tim Schmelter