The simplest way to load a document is to load it from the local filing system:
For embedded systems, or secure applications, the use of a local filing system may be inappropriate, so an alternative is available whereby documents can be opened from a fz_stream. See Stream Stream for more details on fz_streams.
Almost any data source can be wrapped up as a fz_stream; see Stream Stream for more details.
In common with most other objects in MuPDF, fz_documents are reference counted:
Once the last reference to the document is dropped, all resources used by that document will be released, including those in the Store.