title: Orientation sets only for first page in PDF printing - java
body: <p>I'm using PDFRenderer.jar and this is the method i'm using to set print format, </p>
  
  <pre><code>private void initialize(byte[] pdfContent, String jobName) throws IOException, PrinterException {
          ByteBuffer bb = ByteBuffer.wrap(pdfContent);
          // Create PDF Print Page
          PDFFile pdfFile = new PDFFile(bb);
          PDFPrintPage pages = new PDFPrintPage(pdfFile);
  
          // Create Print Job
          pjob = PrinterJob.getPrinterJob();
          PageFormat pf = PrinterJob.getPrinterJob().defaultPage();
  
          pf.setOrientation(PageFormat.PORTRAIT);
          pjob.setJobName(jobName);
  
          Book book = new Book();
          book.append(pages, pf, pdfFile.getNumPages());
          pjob.setPageable(book);
  
  //         to remove margins
          Paper paper = new Paper();
          paper.setSize(paper.getWidth(), paper.getHeight());
          paper.setImageableArea(0, 0, paper.getWidth(), paper.getHeight());
  
          pf.setPaper(paper);
      }
  </code></pre>
  
  <p>The issue is, orientation <em>PORTRAIT</em> sets only to the first page of the pdf,second page comes in <em>REVERSE_LANDSCAPE</em> which I haven't set from the code. </p>
  
  <p>Any ideas?</p>