

Printer Test Pages can be used to identify many issues, including: Test pages often include text, graphics, and images that, when printed, aim to maintain the health of your printer (and cartridges) while highlighting any issues that your printer may be having. Then you could change the setting, completely analogously to the code above, and do the same for the simplex queue.A printer test page is one of the easiest and most effective ways to analyze and calibrate your printer’s performance. in the duplex mode, you can send it the list of all documents that are marked for the duplex printjob. Once you have configured your printer, e.g. Obviously, this only works under MS Windows. Note that you can also print using win32print, thereby saving you the trouble of using subprocess.call or "shelling out" with the win32api. While the official Windows dev center documentation mentions that you could use PRINTER_ACCESS_MANAGE_LIMITED on line 3, win32print does not have this more restricted (but essentially all that is required) global variable defined. > win32print.GetPrinter(handle, level).Duplex > win32print.SetPrinter(handle, level, attributes, 0) > attributes = win32print.GetPrinter(handle, level) > handle = win32print.OpenPrinter(name, printdefaults)

> printdefaults = # Doesn't work with PRINTER_ACCESS_USE > name = win32print.GetDefaultPrinter() # verify that it matches with the name of your printer Note that this works best in a get/set operation: > import win32print This object has other common attributes like color settings (black & white/color/.) and page orientation (lanscape/portrait) as well. You can configure the duplex setting by changing the corresponding attribute of the DevMode object. This value can get TRUE and FALSE, but is there a way to send it when I want to print with my script? ObjSWbemServices = objWMIService.ConnectServer(strComputer,"root\cimv2")ĬolItems = objSWbemServices.ExecQuery("Select * from Win32_PrinterConfiguration") ObjWMIService = ("WbemScripting.SWbemLocator") Now I know this exists #Lists properties and capabilities for all the printers installed on a computer. '/d:"%s"' % win32print.GetDefaultPrinter (),Īn alternative would be this (i have to add the Loop for all files) from subprocess import callĪcrobat = "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" # Acrobat reader would also work, apparently # If this is None, the default printer will # if "11x17" in file and "County" in file:

My Problem is how do I tell the Printer to use Duplex mode?įiles = If there is a D in front of the file Name it is a Duplex and if there is a S it is a simplex. There should be the possibility to Switch the Duplex print mode on and off.

I want to write a python script that prints each file in a Folder on my laser Printer.
