I am using the window.print() function in javaScript to print a page which is executed from a button onClick.
onClick="document.title = 'My new title';window.print();"
You can try it here:
My title Try it