0

I am able to adjust properties like PaperLength, PaperWidth and Orientation using below code snippet. But I am unable to find a way to do something similar with respect to print speed and darkness adjustments.

import win32print


pHandle = win32print.OpenPrinter(str(self.printername.get()))
properties = win32print.GetPrinter(pHandle, 2) 
pDevModeObj = properties["pDevMode"]
pDevModeObj.Orientation = DMORIENT_PORTRAIT
pDevModeObj.PaperLength = int(Length) # Variable
pDevModeObj.PaperWidth = int(Width) # Variable

I have checked a similar post but it has not helped fully. Python win32print changing advanced printer options

D.L
  • 4,339
  • 5
  • 22
  • 45
  • `win32print` is not defined which module does it come from ? – D.L Aug 28 '22 at 13:56
  • win32print module I am importing for this. – Sunil Kumar Aug 29 '22 at 04:05
  • i have modded the question to add this line, but there are still undefined variables `DMORIENT_PORTRAIT`, `Length` & `Width`.... where are these from and what are they ? – D.L Aug 29 '22 at 09:52
  • it looks like a class needs to be instantiated. to help users answer, please ask the question like this: https://stackoverflow.com/help/minimal-reproducible-example – D.L Aug 29 '22 at 09:54

0 Answers0