var docprint = window.open("", "", "toolbar=0,location=0,menubar=0,scrollbars=1"); docprint.document.open(); docprint.document.write("<html><head><title>Title here</title></head>"); docprint.document.write("<body>body content here</body></html>"); docprint.document.close(); docprint.focus(); docprint.print();
This is my javascript code to open a new window and automatically open the print dialog. When the user selects the option to print to Adobe PDF from the print dialog, an option appears in the menu to specify the pdf file name. In Firefox and Chrome, the pdf file name is set as the page title, and this is normal. However, in Internet Explorer, the pdf file name is set as the base name of the parent window. How can I set the pdf file name programmatically in Internet Explorer?
Jakal source share