Need a fast programming language that can drive two printers Need a fast programming language that can drive two printers windows windows

Need a fast programming language that can drive two printers


Being a Python programmer myself, I would use something like MSWinPrint.py, and render the documents directly using Python. It looks like it supports text and images, and you can easily select any printer in the system by name.

You would need to:

  1. Install Python.
  2. Install Python for Windows Extensions.
  3. Install PIL.
  4. Install MSWinPrint.

Then, you would need to write a program to do the printing. Something like the following.

#pythonimport sysimport Image, ImageWinimport MSWinPrint# workaround for PIL namespace changeMSWinPrint.ImageWin = ImageWindef print_name(name, printer_name):    doc = MSWinPrint.document(printer_name)    doc.begin_document('nametag for %s' % name)    # print the name at position 20,20    text_pos = 20, 20    doc.text(text_pos, name)    # add an image for this person    img_pos = 40, 40    img_size = 100, 100    doc.image(img_pos, get_image(), img_size)    doc.end_document()def get_image():    image_filename = 'my image.jpg'    return Image.open(image_filename)if __name__ == '__main__':    name, printer_name = sys.argv[1:]    print_name(name, printer_name)

If you save this as print_tag.py, then you can execute it with two command line arguments, the name to be printed and the image filename.

print_tag.py Sally "EPSON Artisan 810"

I ran this code and it worked great. I didn't know creating a custom print job could be so easy.

You can of course run the program as often as you like on as many printers as you would like. There's certainly more you can do to customize when an how the print job is run. You could customize the code to always run and interpret the mouse clicks (for that you might need wxPython), or you might have another program that just executes the script.


As other have said, the programming language isn't going to make much difference. However (and this is a BIG however), the print libraries built into most scripting languages, such as VBA and .NET, either only support printing to the system default printer (most common, and cannot be worked around by having two instances open simultaneously, as the system default printer is a global setting) or require you to configure a global variable to specify the active printer (this only affects one process, so could be worked around using two instances).

Instead, you will have to invoke the windows API directly. It most certainly allows printing directly to any printer on the system. Here is an example of how to use the default printer. Note that only one line of code (calling the GetDefaultPrinter function) ties this to the default printer. Supplying a different printer name to CreateDC gets you a different printer.

If you instead call the EnumPrinters function, you can find out ANY or ALL of the printer names, not just the default. Or have the administrator preconfigure the printer names to use in a registry setting or text file.

In any case, you can have device contexts for all printers open simultaneously. Of course, once you have the printer device context, you have to create a print job, send your content, and end the print job. There's a great deal of information available on MSDN.

All the examples are in C, which makes C++ the obvious language for printing to non-default printers, but as long as you know how to call WinAPI functions from your language, you can use it instead. In VBA, that'd require Declare Function XYZ Lib "gdi32" (params here)


http://www.microplex-usa.com/

http://www.microplex.co.uk/

These guys printers have own print controller that acts as print manager.