The first step in dealing with a PDF document is to get a handle to it. This is done by opening it as normal using fz_open_document to get a fz_document pointer. To ‘promote’ this to a pdf_document, we use the pdf_specifics call:
If pdf_specifics returns non-NULL, then you know that you are indeed dealing with a PDF format document.
Having a pdf_document pointer allows a series of new APIs to be called (see include/mupdf/pdf/document.h).
In terms of handling a PDF file via its constituent objects, one of the most useful is:
This obtains a pointer to a representation of the trailer dictionary object.