window print default name to pdf code example Example: window.print filename document.title = 'My new title'; window.print();