From c3944e2e1cfb4ac86a8580829376357e1d5bccda Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 5 Jul 2016 16:28:04 +0200 Subject: Add fitz to pdf downcasting functions for pages and annotations. --- include/mupdf/pdf/document.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/mupdf/pdf/document.h b/include/mupdf/pdf/document.h index 0bec12b0..8a8fdd40 100644 --- a/include/mupdf/pdf/document.h +++ b/include/mupdf/pdf/document.h @@ -96,11 +96,22 @@ pdf_document *pdf_open_document_with_stream(fz_context *ctx, fz_stream *file); void pdf_drop_document(fz_context *ctx, pdf_document *doc); /* - pdf_specific: down-cast an fz_document to a pdf_document. + pdf_specifics: down-cast an fz_document to a pdf_document. Returns NULL if underlying document is not PDF */ pdf_document *pdf_specifics(fz_context *ctx, fz_document *doc); +/* + pdf_document_from_fz_document, + pdf_page_from_fz_page, + pdf_annot_from_fz_annot: + Down-cast generic fitz objects into pdf specific variants. + Returns NULL if the objects are not from a PDF document. +*/ +pdf_document *pdf_document_from_fz_document(fz_context *ctx, fz_document *ptr); +pdf_page *pdf_page_from_fz_page(fz_context *ctx, fz_page *ptr); +pdf_annot *pdf_annot_from_fz_annot(fz_context *ctx, fz_annot *ptr); + int pdf_needs_password(fz_context *ctx, pdf_document *doc); int pdf_authenticate_password(fz_context *ctx, pdf_document *doc, const char *pw); -- cgit v1.2.3