I am developing a Python application where it is possible to print an image. I was able to modify some document properties through the win32print library with this code:
import win32print
PRINTER_DEFAULTS = {"DesiredAccess":win32print.PRINTER_ALL_ACCESS}
printer_name = 'DYMO LabelWriter 450'
handle = win32print.OpenPrinter(printer_name, PRINTER_DEFAULTS)
# Get the default properties for the printer
properties = win32print.GetPrinter(handle, 2)
devmode = properties['pDevMode']
devmode.PaperWidth = 600
devmode.PaperLength = 600
devmode.PaperSize = 0
properties["pDevMode"]=devmode
win32print.SetPrinter(handle,2,properties,0)
but I don't know how to change advanced properties such as, for example, the document format (A3, A4, ..)