Click here to Skip to main content
13,044,705 members (64,704 online)
Rate this:
Please Sign up or sign in to vote.
See more:
How to get client printer list?

I am using and I want Printers installed on client machine, Please Help...
Posted 31-Oct-12 17:52pm
Updated 31-Oct-12 17:53pm
John Bhatt 1-Nov-12 2:35am
A foolish but Good question.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

You can use javascript function window.Print()
This will list you client machine printers and print your page.
Below is code that you can try yourself.

function printpage()
<input type="button" value="Print this page" onclick="printpage()">
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

A Web application does not have access to client systems, for a good reason. Imagine for a second that it was possible. Would any reasonable user like that some unknown site could discover printers or other equipment? This even sounds scary.

This article explains how to print using ASP.NET:[^].

Note that the server side only provides printable content, and all the detail of printing selection, printing quality and other options totally happens on the client side, in a way designed in client's OS. This is the only reasonable and safe way.

Even this way seems to be a bit too redundant and intrusive, to my taste. I personally think that the user knows better when to print, what to print and how. You better just provide printer-friendly content. A while ago, some special "printable version" anchors were in fashion, but you should admit that this is not elegant, especially in terms of site maintenance. Much better approach is using CSS media types. Please see:[^].

See also my past answer on the topic:
Print to LPT1 port using[^].

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

No.. It is not possible. A web application has very limited access to the client machine's hardware. At the most you can call the default printer to popup the print dialog.

The limitation on getting the printer list is a security feature so that a hacker should not get the printer details to hack it to print the restaurant menus whenever a user accesses the website.:)

You should leave the choice of printing to the user because the website is yours, not the printer..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 1 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100