/** * Gets the number of {@link PdfAnnotation} associated with this page. * * @return the {@code int} number of {@link PdfAnnotation} associated with this page. */ public int getAnnotsSize() { PdfArray annots = getAnnots(false); if (annots == null) return 0; return annots.size(); }
private void flushResourcesContentStreams() { flushResourcesContentStreams(getResources().getPdfObject()); PdfArray annots = getAnnots(false); if (annots != null) { for (int i = 0; i < annots.size(); ++i) { PdfDictionary apDict = annots.getAsDictionary(i).getAsDictionary(PdfName.AP); if (apDict != null) { flushAppearanceStreams(apDict); } } } }
PdfArray annots = getAnnots(false); if (annots != null) { annots.remove(annotation.getPdfObject());
PdfArray annots = getAnnots(true); if (index == -1) { annots.add(annotation.setPage(this).getPdfObject());