title: Print PDF file in duplex mode via Python
body: <p>I have an script in Python that prints PDF files.<br>
  The script works using <code>win32api.ShellExecute()</code> and everything is fine, but now, I need to print PDF files that have double sided content, user manuals in concrete.<br>
  I have tried setting the duplex mode in win32print, but nothing works, the printer still print 2 pages on 2 sheets for my PDF instead of two pages on a double sided sheet.
  The printer works with this mode in other applications, but with the python script doesn't work well.
  This is part of the code I used to print:  </p>
  
  <pre><code>name = win32print.GetDefaultPrinter()
  printdefaults = {"DesiredAccess": win32print.PRINTER_ALL_ACCESS}
  handle = win32print.OpenPrinter(name, printdefaults)
  level = 2
  attributes = win32print.GetPrinter(handle, level)
  attributes['pDevMode'].Duplex
  attributes['pDevMode'].Duplex = 1
  win32print.SetPrinter(handle, level, attributes, 0)
  win32print.GetPrinter(handle, level)['pDevMode'].Duplex
  win32api.ShellExecute(0,'print','file.pdf','.','/route',0)
  </code></pre>
  
  <p>Any idea why this doesn't works? Thanks.</p>