title: Select bin/tray when printing with javax.print
body: <p>I'd like to specify the input bins when printing with Java. I've found the MediaTray class which should correspond to the input bins:</p>
  <pre><code>The following standard values are defined for input-trays (from ISO
  DPA and the Printer MIB):
  
  'top': The top input tray in the printer.
  'middle': The middle input tray in the printer.
  'bottom': The bottom input tray in the printer.
  'envelope': The envelope input tray in the printer.
  'manual': The manual feed input tray in the printer.
  'large-capacity': The large capacity input tray in the printer.
  'main': The main input tray
  'side': The side input tray
  </code></pre>
  <p>Source: <a href="https://www.rfc-editor.org/rfc/rfc2911" rel="nofollow noreferrer">https://www.rfc-editor.org/rfc/rfc2911</a></p>
  <p>The problem is, that I get a number from the application which specifies the input bin. Can I simply map the enum int values or what is the common way to get to the enum value with a number? Is it even officially supported to number the trays?</p>
  <p>I couldn't find attributes in the RFC that correspond to the output bins. Is there also a way to do that?</p>
  <p>And the most important question: Is the printer interface more or less reliable? Most threads I found where people asked about the trays eventually gave up, because they couldn't get it to work.</p>
  <p>Any experiences would be appreciated.</p>