title: Print duplex in Java
body: <p>How can I print duplex in java!?</p>
  
  <p>Here's my code, but it didn't work - it only works in microsoft word (so the printer can do it)</p>
  
  <pre><code>PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
      pras.add(new Copies(2));
      pras.add(Sides.DUPLEX);
  
  PrinterJob pj = PrinterJob.getPrinterJob();
      PageFormat pf = pj.defaultPage();
      Paper temp = pf.getPaper();
  
      temp.setImageableArea(1, 3, temp.getWidth(), temp.getHeight());
      pf.setPaper(temp);
  
      if (pj.printDialog(pras)) {
          try {
              pj.setPrintable(this, pf);
              pj.print(pras); //  Drucken
              return true;
          } catch (Exception PrintException) {
              .....
          }
  </code></pre>
  
  <p>I tried to give only the attributes to print, only to the dialog, etc. etc. etc.
  It print's the document 2 times, but not duplex! (also tried Sides.TWO_SIDED_LONG_EDGE..)</p>