Skip to content
Guides

Delete Form Fields

Since the form fields class inherits from the annotation class, the way to delete form fields is the same as delete annotations.

The steps to delete form fields are as follows:

  1. Obtain the page object from CPDFDocument where you want to delete the form field.
  2. Delete the form field.

This example shows how to delete form fields:

java
CPDFDocument document = new CPDFDocument();
document.open(pdfPath);
CPDFPage page = document.pageAtIndex(0);

List<CPDFAnnotation> annotationList = page.getAnnotations();
annotationList.remove(0);