Some test text!

Remove form fieldskeyboard_arrow_down

Remove PDF form fields

A form field can be removed by deleting its widget annotations. This will remove the ability to interact with the form field since widget annotations represent the appearances of form fields in a PDF document.

Its important to note that a form field can be associated to multiple widget annotations which means there can be multiple interactive appearances and locations in a document for a single form field.

Remove all fields

To remove all form fields in a document, you can remove all widget annotations.

  .then(instance => {
    const { docViewer, annotManager, Annotations } = instance;

    docViewer.on('annotationsLoaded', () => {
      const annots = annotManager.getAnnotationsList();

      // find the widget annotations
      const widgetAnnots = annots.filter(a => a instanceof Annotations.WidgetAnnotation)

      // remove the widget annotations

Remove fields by name

To remove a single field, you can find a field by its name and then delete its widget annotations.

  .then(instance => {
    const { docViewer, annotManager } = instance;

    docViewer.on('annotationsLoaded', () => {
      const fieldManager = annotManager.getFieldManager();
      const field = fieldManager.getField('fieldName');

Get the answers you need: Support


Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.