/** * 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); }
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); }