Hello, dear friends, I’m trying to modify python-node from the package: Archi-lab_Grimshaw → Printing → Local Printers Names.
I need to get the list of network printers.
I have dully tried to replace all PRINTER_ENUM_LOCALs to PRINTER_ENUM_NETWORKs, but this didn’t help xD
import clr
clr.AddReference(‘System.Drawing’)
import System
n = System.Drawing.Printing.PrinterSettings.InstalledPrinters.Count
prt = []
for i in range(n):
____prt.append(System.Drawing.Printing.PrinterSettings.InstalledPrinters[i])
OUT = prt
msvcrt = ctypes.cdll.msvcrt # for malloc, free # Parameters: modify as you need. See MSDN for detail. PRINTER_ENUM_LOCAL = 2
Name = None # ignored for PRINTER_ENUM_LOCAL
Level = 1 # or 2, 4, 5
Change this line
PRINTER_ENUM_LOCAL = 2 …this will list local printers
To
PRINTER_ENUM_LOCAL = 4 …this will list only network printers
To
PRINTER_ENUM_LOCAL = 6 …this will list both local and network printers…
As i said the above code you post is much shorter code which has same results. Just thought sharing this just to answer your first post.