deathkda.blogg.se

Laser printer test page pdf
Laser printer test page pdf













> 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

laser printer test page pdf

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

laser printer test page pdf

# 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.















Laser printer test page pdf