close

open override fun close()

Closes the document and releases its PDFium resources.

On JVM, Android, and iOS, this call waits synchronously for any active PDFium operation. Avoid calling it from a UI thread while page work may still be running; use closeAndAwait from a coroutine instead.

Closing is idempotent. If the first close attempt fails, every later close call rethrows that same failure without repeating cleanup.