You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by RamanaJV <ra...@esntechnologies.co.in> on 2002/07/23 09:00:30 UTC

Duplex printing

Dear All,
      I'm trying to print the pages in duplex mode. I have written the
following function. But this is not working.  Is it a problem with JDK or
with FOP. When I call this method, a printer dialog is shown with the option
duplex selected, but the pages are not printed in duplex mode. I'm able to
duplex print from microsoft applications.
  
 private void printToPrinter()
 {
  // Build a set of attributes
  PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet(); 
  aset.add(Sides.DUPLEX); 
 
  PrinterJob pj = PrinterJob.getPrinterJob();
   if (pj.printDialog(aset))
   {
 
    //  <file:// renderer> renderer is AWT renderer
    pj.setPageable(renderer);
    try
    {
     pj.print(aset);
    }
    catch (PrinterException pe)
    {
     pe.printStackTrace();
    }
   }
 }
 Please correct me, 
 
Ramana.