title: openpyxl - set custom paper size for printing
body: <p>I want to set the paper size print option to <strong>A6</strong> or a <strong>custom user size template</strong> with <code>openpyxl</code>, the code would be as follows:</p>
  
  <pre><code>    workbook = Workbook()
      ws = workbook.active
      ws.page_setup.paperSize = ws.PAPERSIZE_CUSTOM
  </code></pre>
  
  <p>unfortunately, from the docs, it seems the only enumerated sizes available are:</p>
  
  <pre><code>PAPERSIZE_LETTER = '1'
  PAPERSIZE_LETTER_SMALL = '2'
  PAPERSIZE_TABLOID = '3'
  PAPERSIZE_LEDGER = '4'
  PAPERSIZE_LEGAL = '5'
  PAPERSIZE_STATEMENT = '6'
  PAPERSIZE_EXECUTIVE = '7'
  PAPERSIZE_A3 = '8'
  PAPERSIZE_A4 = '9'
  PAPERSIZE_A4_SMALL = '10'
  PAPERSIZE_A5 = '11'
  </code></pre>
  
  <p>I've tried setting the paper height and paper width to my custom properties as such:</p>
  
  <pre><code>    #ws.page_setup.paperSize = ws.PAPERSIZE_A6
      ws.page_setup.paperHeight = '105mm'
      ws.page_setup.paperWidth = '148mm'
  </code></pre>
  
  <p>however, when printing thru excel, I still have to use the drop down dialog to select 'A6' before I can print to the correct paper size.</p>
  
  <p>Is there a way I can do this? or achieve a similar effect? I'm on Mac OS if that matters.</p>