close method

Future<void> close()

Frees the document. The worker runs this ahead of anything queued and drops the document's queued requests (their futures fail), so closing isn't held up behind a strip of thumbnails.

Implementation

Future<void> close() async {
  if (_closed) return;
  _closed = true;
  _finalizer.detach(this);
  await _Worker.instance.call(PdfiumOp.close, [_id]);
}