コード例 #1
0
 /**
  * If we store all the objects, we might run out of memory; that's why we'll only store the
  * objects that are necessary to construct other objects (for instance the page table).
  *
  * @param object an object we might want to store
  */
 private void store(PdfObject object) {
   if (object.isDictionary()) {
     PdfDictionary dict = (PdfDictionary) object;
     if (PdfName.PAGE.equals(dict.get(PdfName.TYPE))) {
       objects.add(dict);
       return;
     }
   }
   objects.add(PdfNull.PDFNULL);
 }
コード例 #2
0
 public static PdfObjectTreeNode getInstance(PdfObject object) {
   if (object.isDictionary()) {
     if (PdfName.PAGE.equals(((PdfDictionary) object).get(PdfName.TYPE))) {
       return new PdfPageTreeNode((PdfDictionary) object);
     } else if (PdfName.PAGES.equals(((PdfDictionary) object).get(PdfName.TYPE))) {
       return new PdfPagesTreeNode((PdfDictionary) object);
     }
   }
   return new PdfObjectTreeNode(object);
 }