Example #1
0
 /** convenience method. Given an imported page, set our "globals" */
 protected int setFromIPage(PdfImportedPage iPage) {
   int pageNum = iPage.getPageNumber();
   PdfReaderInstance inst = currentPdfReaderInstance = iPage.getPdfReaderInstance();
   reader = inst.getReader();
   setFromReader(reader);
   return pageNum;
 }
Example #2
0
 /**
  * Signals that the <CODE>Document</CODE> was closed and that no other <CODE>Elements</CODE> will
  * be added.
  *
  * <p>The pages-tree is built and written to the outputstream. A Catalog is constructed, as well
  * as an Info-object, the reference table is composed and everything is written to the
  * outputstream embedded in a Trailer.
  */
 public void close() {
   if (open) {
     PdfReaderInstance ri = currentPdfReaderInstance;
     pdf.close();
     super.close();
     if (ri != null) {
       try {
         ri.getReader().close();
         ri.getReaderFile().close();
       } catch (IOException ioe) {
         // empty on purpose
       }
     }
   }
 }