MuPDF is written as an extensible framework for handling different document types. Each different document format provides a fz_document_handler structure that provides the required callbacks to recognise and open files of its supported type. For example:
At startup, the calling program must register the required document handlers. It can either register them each individually, by repeatedly calling fz_register_document_handler:
For example:
or, it can use a convenience function to register all the standard handlers enabled in a given build: