title: python win32print can't set custom page size
body: <p>i am trying to print pdf file with custom page size in python with win32print i can change other setting like number of  copies but setting custom page length and width is not working it always try to fit pdf content into page by covering whole page this is my code</p>
  <pre><code>printers=win32print.EnumPrinters(win32print.PRINTER_ENUM_LOCAL)
  PRINTER_DEFAULTS = {&quot;DesiredAccess&quot;:win32print.PRINTER_ALL_ACCESS}
  temprint=printers[1][2]
  handle = win32print.OpenPrinter(temprint, PRINTER_DEFAULTS)
  level = 2
  attributes = win32print.GetPrinter(handle, level)
  attributes['pDevMode'].PaperWidth = 600  
  attributes['pDevMode'].PaperLength = 30  
  attributes['pDevMode'].PaperSize =0 
  print(win32print.SetPrinter(handle, level, attributes, 0))
  win32api.ShellExecute(0,'printto','test.pdf','&quot;%s&quot;' % temprint,'.',0)
  win32print.ClosePrinter(handle)
  </code></pre>
  <p>can anyone tell me what i am doing wrong here</p>