printers

Windows API for detecting out of paper on specific printer tray

I'm looking for a way to determine if a specific tray on a given printer in Windows is out of paper. Currenly I'm using the WMI Win32_Printer object to get the status of the entire printer, and if one of the trays is out of paper I do get a status that tells me the entire printer is out of paper. But I'd like to know if a specific tr...

How to get Printer Info in .NET?

In the standard PrintDialog there are four values associated with a selected printer: Status, Type, Where, and Comment. If I know a printer's name, how can I get these values in C# 2.0? ...

Change default printer based on location

I would like to write a VBScript to change the default printer, based on which printer is connected. I have a laptop that I use at work and at home, and I would like to run this script when starting windows so the default printer is always the correct one. If there is another way to do this in XP, I'm all ears. ...

Enumerate printers for a specific Terminal Server session

I am looking for a way to see what printers a specific user has mapped into his or her TS session. How can I achieve this with WMI (via PowerShell) or VB-Script? Is there a built-in way I'm not aware of? EDIT: In our construct mapping of local printers by the RDP-Client is disabled. Users get their printers created during login via VBS...

"Invalid procedure call or argument" when setting Printer object

I have a VB6 application that is giving an error 5, "Invalid procedure call or argument" when the program attempts to set the Printer object to a specific printer from the Printers collection. The printer in question is some sort of copier/printer running through a print server. The error doesn't occur when setting the Printer object to ...

How to list all the printers on the network?

I am trying to list all the printers on the network (we have a very large, cross-ocean network) using VS2008 & c#. I am looking to replicate the functionality of the Find Printers dialog box in Windows (which can be found by going to Printers and Faxes, clicking Add a printer, selecting Network Printer, then picking Find a printer in ...

dot matrix paper reverse feed in C#

In my application i am printing tripsheets by dot matrix printer. Now I have to implicitly eject extra paper so that i can easily tear it from the perforated line.But for the next invoice or tripsheet it is esential to reverse feed the paper so that the printing starts from the top. The problem is how to reverse feed the paper.Is there a...

How can I locate all the network printers in the enterprise?

When I go to Printers and Faxes dialog, I can click the Add a printer link, select Network Printer, then Find a printer in the directory. From there I get a dialog box which lets me find ALL printers in the enterprise. I need to find all the network printers with my code. How can I do this? Note that I am not talking about network p...

How to get status from POS Printer

Hello, i'm trying to find a way to get paper status from a POS printer; i think i would use GS a, GS r sequence but i cannot understand how to return info from the printer; i'm under Linux, where does the POS printer returns info about status? Thanks in advance, Cris ...

DevMode Structure

I have files I need to drive thru a print driver and save then as files. Can I programactly use the DevMode Structure to drive these files without openning the application it was created in? Also can I change the DevMode Structure values to change to other file types programmatically and continue to drive them and save them to files? ...

How can I get/set default printers on a per-user basis in Terminal Services with C#?

I want to be able to get and set the default printer for users within Windows Terminal Services, but I don't see any relevant functions. (The closest I've seen is RDS User Config, but it doesn't appear to do what I need.) It can be done by name or by ID (however necessary). For example, something like this pseudocode: For each user, u: ...

Is there anyway to specify a PrintTo printer when spawning a process?

What I Have I am currently writing a program which takes a specified file and the performs some action with it. Currently it opens it, and/or attaches it to an email and mails it to specified addresses. The file can either be of the formats: Excel, Excel Report, Word, or PDF. What I am currently doing is spawning a process with the pa...

Get client printers from asp.net application

I have a asp.net application coded in C#. I need to get the list with printers from client computer. From what I know this can be done using a ActiveX control or java that runs on clinet. Do you know some ActiveX or java componets that do that ? Or a simple method to accomplish this. Thanks. ...

Delphi: PJL commands to printer and reading the responses back

Im struggling with getting information back from the printer when sending PJL to the printer. The printer supports PJL and it is a USB printer. Now getting information / examples seems to be a problem or I'm looking at the wrong places. I know on MSDN there are a lot of information, but I've tried everything I got there, from docinfo's t...

Can't add new Redirected Port in Windows 7 after installing RedMon

My operating system is Windows 7 32bit. I installed RedMon1.7, Ghostscript 8.71 and GSview 4.9; installations were successful. I went to Add New Local Printer in Windows Devices and Printers, clicked on Create A New Port, and selected Redirected Port from the Type of Port list. Clicked Next and in the Add New Port window I named RPT1: an...

How to fix the Win32_Printer.Default field so that it returns the correct value when using WMI remotely?

The Win32_Printer class returns a field per printer called Default (a boolean value). This works locally and accurately returns the Default printer. However when remotely connecting in with WMI, it always returns false. I thought it could depend on the user with which you did the remote WMI query. However, that's not the case (I tried i...