Module MuPDF.Document

Documents.

type t = document

A document.

val register_handlers : unit -> unit

Register handlers for all the standard document types supported in this build.

val open_document : string -> t

Open a document file and read its basic structure so pages and objects can be located. MuPDF will try to repair broken documents (without actually changing the file contents).

val close : document -> unit
val count_pages : document -> int

Return the number of pages in document.

val load_page : document -> int -> Page.t

Load a given page number from a document. This may be much less efficient than loading by location (chapter+page) for some document types.

val pages : document -> Page.t list

All pages of the document.

val last_page : document -> Mupdf_ffi.Types_generated.location Ctypes.structure Mupdf_ffi.Mupdf__c_generated_functions__Function_description__Functions.return

Get the location for the last page in the document. Using this can be far more efficient in some cases than calling count_pages and using the page number.

val count_chapters : document -> int

Number of chapters in the document.