clear method

void clear()

Removes all the bookmark from the collection.

//Load the PDF document.
PdfDocument document = PdfDocument(inputBytes: inputBytes);
//Clear all the bookmarks.
document.bookmarks.clear();
//Save the document.
List<int> bytes = await document.save();
//Dispose the document.
document.dispose();

Implementation

void clear() {
  _list.clear();
  if (_bookmark != null) {
    _bookmark!.clear();
  }
  if (_booklist != null) {
    _booklist!.clear();
  }
  _updateFields();
}