Is it possible to fetch the name of default printer from javascript? I need only the name of the printer and display a dialogue asking the user to manually change his default printer, if the default printer doesn't meet my appliation requirement. Im using plain javascript
Asked
Active
Viewed 6,689 times
4 Answers
1
In "plain" javascript this is not possible. Please add more details to your question if you're using some HTML5-ish related API.

napolux
- 15,574
- 9
- 51
- 70
1
This is not possible.
Related: Disabling browser print options (headers, footers, margins) from page?
You can of course change the layout of the printed page using @media print { ... }
in your stylesheets or using media='print'
in your link
element.

Community
- 1
- 1

Joram van den Boezem
- 1,104
- 10
- 24
0
You may use flash or Java applets or silverlight to identify the default printer name. It works only if the client has those plugins.
Alternate, You can access it using ActiveXObject(). But a big note: Its IE Specific. It depends on the users of your site. Even VBScript would work for IE browsers.

devsathish
- 2,339
- 2
- 20
- 16
0
var oShell = new ActiveXObject("WScript.Shell");
sRegVal = 'HKEY_CURRENT_USER\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\Device';
var sName = oShell.RegRead(sRegVal)
From: codeproject: how to get the client printer name using javascript

klaasjan69
- 181
- 2
- 7