public PdfArray getKids() { return getPdfObject().getAsArray(PdfName.Kids); }
public void addPages(PdfPages pdfPages) { kids.add(pdfPages.getPdfObject()); count.setValue(count.intValue() + pdfPages.getCount()); pdfPages.getPdfObject().put(PdfName.Parent, getPdfObject()); setModified(); }
public PdfPages(int from, PdfDocument pdfDocument, PdfPages parent) { super(new PdfDictionary()); if (pdfDocument.getWriter() != null) { getPdfObject().makeIndirect(pdfDocument); } setForbidRelease(); this.from = from; this.count = new PdfNumber(0); this.kids = new PdfArray(); this.parent = parent; getPdfObject().put(PdfName.Type, PdfName.Pages); getPdfObject().put(PdfName.Kids, this.kids); getPdfObject().put(PdfName.Count, this.count); if (parent != null) { getPdfObject().put(PdfName.Parent, this.parent.getPdfObject()); } }
public void addPage(PdfDictionary page) { kids.add(page); incrementCount(); page.put(PdfName.Parent, getPdfObject()); }
private static PdfObject getInheritedValue(PdfPages parentPages, PdfName pdfName) { if (parentPages != null) { PdfDictionary parentDictionary = parentPages.getPdfObject(); PdfObject value = parentDictionary.get(pdfName); if (value != null) { return value; } else { return getInheritedValue(parentPages.getParent(), pdfName); } } return null; }
return root.getPdfObject();
public void removeFromParent() { if (parent != null) { assert getCount() == 0; parent.kids.remove(getPdfObject().getIndirectReference()); if (parent.getCount() == 0) { parent.removeFromParent(); } } }
public boolean addPage(int index, PdfPage pdfPage) { if (index < from || index > from + getCount()) return false; kids.add(index - from, pdfPage.getPdfObject()); pdfPage.getPdfObject().put(PdfName.Parent, getPdfObject()); incrementCount(); setModified(); return true; }
if (lastPdfPages == null) { // possible if only first kid is PdfPage lastPdfPages = new PdfPages(parent.getFrom(), document, parent); kids.set(i, lastPdfPages.getPdfObject()); newParents.add(lastPdfPages); } else {