Syncfusion AI Assistant

How can I help you?

Remove PDF form fields from a PDF

16 Feb 20261 minute to read

Remove form fields using the UI

Steps:

  1. Enable Form Designer mode.
  2. Select the form field.
  3. Click Delete in the toolbar or press the Delete key.
    Form Designer toolbar with Delete icon

Remove form fields programmatically

Use deleteFormField() with a field reference or ID

<button id="deleteAllFields">Delete Form Fields</button>
<button id="deleteById">Delete First Field By ID</button>
// Delete all added form fields on button click
(document.getElementById('deleteAllFields') as HTMLButtonElement).addEventListener('click', () => {
  const fields = [...pdfviewer.formFieldCollections]; // clone to avoid mutation issues
  fields.forEach(field => pdfviewer.formDesignerModule.deleteFormField(field));
});

// Delete by ID on button click (example uses the first field's ID)
(document.getElementById('deleteById') as HTMLButtonElement).addEventListener('click', () => {
  if (pdfviewer.formFieldCollections.length > 0) {
    const id = pdfviewer.formFieldCollections[0].id;
    if (id) {
      pdfviewer.formDesignerModule.deleteFormField(id);
    }
  }
});

View Sample on GitHub

See also