PDA

View Full Version : To get print dialog



Mithra
3 Oct 2012, 3:15 AM
Hi,

I want a print dialog box to popup where I can set the printer name .Is there any other methods to get the printer names available in the system.If anyone knows please help me.

Thanks and Regards
Mithra

harman
3 Oct 2012, 6:20 AM
The thing you are asking is not exactly ExtJS property but the OS and Interface you use.

If you want to print something its simple javascript.
You can try something like


var myWindow = window.open('', '', 'width=900,height=900');
myWindow.document.write('<html><head>');
myWindow.document.write('<title>' + 'Title ' + new Date() + '</title>');
myWindow.document.write('</head><body>');
myWindow.document.write(whatever HTML);
myWindow.document.write('</body></html>');
myWindow.document.close();
myWindow.focus();
myWindow.print();


this would open up the print dialogue automatically.

Mithra
5 Oct 2012, 4:37 AM
Thank you Harman for your suggestions.

harman
8 Oct 2012, 1:32 AM
You can also do

window.print();
simply to print the current window.