From 697f6a7cc3eb4230fcf0825b23125c54cbbe412b Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 24 Aug 2015 10:25:42 +0100 Subject: GProof: Hook up fz_meta - just for 'format' currently. This will be useful for identifying when we are proofing. --- source/gprf/gprf-doc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source') diff --git a/source/gprf/gprf-doc.c b/source/gprf/gprf-doc.c index 8536bfc9..0e33e4c3 100644 --- a/source/gprf/gprf-doc.c +++ b/source/gprf/gprf-doc.c @@ -783,6 +783,15 @@ gprf_close_document(fz_context *ctx, fz_document *doc_) fz_free(ctx, doc); } +static int +gprf_lookup_metadata(fz_context *ctx, fz_document *doc, const char *key, char *buf, int size) +{ + if (!strcmp(key, "format")) + return fz_snprintf(buf, size, "GPROOF"); + + return -1; +} + static fz_document * gprf_open_document_with_stream(fz_context *ctx, fz_stream *file) { @@ -792,6 +801,7 @@ gprf_open_document_with_stream(fz_context *ctx, fz_stream *file) doc->super.close = gprf_close_document; doc->super.count_pages = gprf_count_pages; doc->super.load_page = gprf_load_page; + doc->super.lookup_metadata = gprf_lookup_metadata; fz_try(ctx) { -- cgit v1.2.3