@Test public void removeFlushedPageFromTaggedDocument() { try (PdfDocument pdfDocument = new PdfDocument(new PdfWriter(new ByteArrayOutputStream()))) { pdfDocument.setTagged(); pdfDocument.addNewPage(); pdfDocument.getPage(1).flush(); junitExpectedException.expect(PdfException.class); junitExpectedException.expectMessage(PdfException.FLUSHED_PAGE_CANNOT_BE_REMOVED); pdfDocument.removePage(1); } }
public boolean removePage(int pageNum) { if (pageNum < from || pageNum >= from + getCount()) return false; decrementCount(); kids.remove(pageNum - from); return true; }
PdfPages extends PdfObjectWrapper<PdfDictionary> { public boolean removePage(int pageNum) { if (pageNum < from || pageNum >= from + getCount()) return false; decrementCount(); kids.remove(pageNum - from); return true; } }
PdfPages extends PdfObjectWrapper<PdfDictionary> { public boolean removePage(int pageNum) { if (pageNum < from || pageNum >= from + getCount()) return false; decrementCount(); kids.remove(pageNum - from); return true; } PdfPages(int from, PdfDocument pdfDocument, PdfPages parent);  PdfPages(int from, PdfDocument pdfDocument);  PdfPages(int from, int maxCount, PdfDictionary pdfObject, PdfPages parent); }
PdfPages extends PdfObjectWrapper<PdfDictionary> { public boolean removePage(int pageNum) { if (pageNum < from || pageNum >= from + getCount()) return false; decrementCount(); kids.remove(pageNum - from); return true; } PdfPages(int from, PdfDocument pdfDocument, PdfPages parent);  PdfPages(int from, PdfDocument pdfDocument);  PdfPages(int from, int maxCount, PdfDictionary pdfObject, PdfPages parent); void addPage(PdfDictionary page); boolean addPage(int index, PdfPage pdfPage); boolean removePage(int pageNum); void addPages(PdfPages pdfPages); void removeFromParent(); int getFrom(); int getCount(); void correctFrom(int correction); PdfArray getKids(); PdfPages getParent(); void incrementCount(); void decrementCount(); int compareTo(int index); }
PdfPages extends PdfObjectWrapper<PdfDictionary> { public boolean removePage(int pageNum) { if (pageNum < from || pageNum >= from + getCount()) return false; decrementCount(); kids.remove(pageNum - from); return true; } PdfPages(int from, PdfDocument pdfDocument, PdfPages parent);  PdfPages(int from, PdfDocument pdfDocument);  PdfPages(int from, int maxCount, PdfDictionary pdfObject, PdfPages parent); void addPage(PdfDictionary page); boolean addPage(int index, PdfPage pdfPage); boolean removePage(int pageNum); void addPages(PdfPages pdfPages); void removeFromParent(); int getFrom(); int getCount(); void correctFrom(int correction); PdfArray getKids(); PdfPages getParent(); void incrementCount(); void decrementCount(); int compareTo(int index);  }