473,396 Members | 2,070 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Automatic printer installation/creation

Is there a way from within a C# app to create a printer? I am looking to
automate the creation of (possibly) dozens of printers, to prevent having to
go through the "Add Printer Wizard" so many times. The app will have
access to all the info necessary as if "Add Printer Wizard" was being used, I
just need to know if there's an elegant way to do this (short of nasty
registry hacks).
May 11 '07 #1
2 3698
I am trying to do the same thing. I have searched the web extensivly and came
up with two examples:
http://www.developerfusion.co.uk/show/5450/2/
http://www.thescripts.com/forum/thread223709.html

they compile without errors but when I try to accually use them they both
come up with a generic error (that is of no help figuring out what is causing
the error).

"ReynoldsUser" wrote:
Is there a way from within a C# app to create a printer? I am looking to
automate the creation of (possibly) dozens of printers, to prevent having to
go through the "Add Printer Wizard" so many times. The app will have
access to all the info necessary as if "Add Printer Wizard" was being used, I
just need to know if there's an elegant way to do this (short of nasty
registry hacks).
May 16 '07 #2
Thanks for the reply - I think we have actually got this working now here.
We are using the Interop services, and making an API call (AddPrinter) to do
what we want. We found some additional information here:
http://www.printdistributor.com/forum/post/121

The structures referenced are explained here:
http://msdn2.microsoft.com/en-us/library/ms536023.aspx
and
http://msdn2.microsoft.com/en-us/library/ms535509.aspx

I was also able to do the reverse, namely delete the printer that I
previously created, by using the DeletePrinter function. Good luck.
"David Hogenkamp" wrote:
I am trying to do the same thing. I have searched the web extensivly and came
up with two examples:
http://www.developerfusion.co.uk/show/5450/2/
http://www.thescripts.com/forum/thread223709.html

they compile without errors but when I try to accually use them they both
come up with a generic error (that is of no help figuring out what is causing
the error).

"ReynoldsUser" wrote:
Is there a way from within a C# app to create a printer? I am looking to
automate the creation of (possibly) dozens of printers, to prevent having to
go through the "Add Printer Wizard" so many times. The app will have
access to all the info necessary as if "Add Printer Wizard" was being used, I
just need to know if there's an elegant way to do this (short of nasty
registry hacks).
May 16 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: CH3 | last post by:
Hi, I've not done any programming for years, but I would like to write a simple program/script to help with something at work. We have several print servers for our 2000+ users, and whenever we...
0
by: Rob | last post by:
I'm having a problem with the printer for a program I've created. I have to recreate a data table on a page to be printed. Earlier today it worked fine; however, I am now having an odd problem:...
2
by: GMane Python | last post by:
Anyone know if there's a module which will allow me to 'create' windows printer definitions? Not from a Windows domain network, but just to add a printer that sends to a jet-direct-attached...
6
by: PW | last post by:
I have an electronic cash drawer as part of a point-of-sale installation. You're supposed to be able to automatically open the cash drawer with some printer commands (drawer is connected to the...
1
by: yongsing | last post by:
I wanted to install DB2 client on a Redhat Linux 9 system so that I can run Java programs to access a remote DB2 V7.2 database. So I installed DB2 EE v7.1 on the system, selecting only the...
0
by: coolsilver.net | last post by:
I am not sure if I am in the right group. My problem is this: My VB.NET application prints to the Epson printer using Epson OPOS drivers. I have downloaded the Epson ADK for .NET from the...
2
by: Terry Olsen | last post by:
Can anyone give me some guidance on installing a local printer with VB 2005? I'm guessing I would probably do this with WMI, but i'm not finding anything obvious. I see how to add a networked...
58
by: Jorge Peixoto de Morais Neto | last post by:
I was reading the code of FFmpeg and it seems that they use malloc just too much. The problems and dangers of malloc are widely known. Malloc also has some overhead (although I don't know what is...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.