removeField method

bool removeField(
  1. PdfIndirect reference
)

Removes from /Fields the entry that points to reference.

Looks in the root first and then descends through /Kids. An intermediate node left without children is removed along with it: a field with no widget and no /Kids is no longer reachable by the reader, and leaving it pointing to nothing is exactly the inconsistency item D3 of the roadmap describes.

Returns true when some entry was taken out.

Implementation

bool removeField(PdfIndirect reference) {
  final fields = writableFields();
  if (fields == null) return false;
  return _removeFromFieldList(fields, reference, 0);
}