From 3fa5683ad391f478e77bd69891ef12b2abb29928 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 1 Apr 2014 17:10:02 +0200 Subject: Update examples. --- docs/example.c | 6 +++++- docs/multi-threaded.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/example.c b/docs/example.c index cf7d0176..660d394b 100644 --- a/docs/example.c +++ b/docs/example.c @@ -3,7 +3,7 @@ // Compile a debug build of mupdf, then compile and run this example: // // gcc -g -o build/debug/example -Iinclude docs/example.c \ -// build/debug/libmupdf.a build/debug/libmupdf-js-none.a \ +// build/debug/libmupdf.a \ // build/debug/libfreetype.a build/debug/libjbig2dec.a \ // build/debug/libjpeg.a build/debug/libopenjpeg.a \ // build/debug/libz.a -lm @@ -20,6 +20,10 @@ render(char *filename, int pagenumber, int zoom, int rotation) fz_context *ctx = fz_new_context(NULL, NULL, FZ_STORE_UNLIMITED); + // Register the default file types. + + fz_register_document_handlers(ctx); + // Open the PDF, XPS or CBZ document. fz_document *doc = fz_open_document(ctx, filename); diff --git a/docs/multi-threaded.c b/docs/multi-threaded.c index 5fde043c..4ba7395e 100644 --- a/docs/multi-threaded.c +++ b/docs/multi-threaded.c @@ -14,7 +14,7 @@ // Compile a debug build of mupdf, then compile and run this example: // // gcc -g -o build/debug/example-mt -Iinclude docs/multi-threaded.c \ -// build/debug/libmupdf.a build/debug/libmupdf-js-none.a \ +// build/debug/libmupdf.a \ // build/debug/libfreetype.a build/debug/libjbig2dec.a \ // build/debug/libjpeg.a build/debug/libopenjpeg.a \ // build/debug/libz.a -lpthread -lm @@ -160,6 +160,10 @@ int main(int argc, char **argv) fz_context *ctx = fz_new_context(NULL, &locks, FZ_STORE_UNLIMITED); + // Register default file types. + + fz_register_document_handlers(ctx); + // Open the PDF, XPS or CBZ document. Note, this binds doc to ctx. // You must only ever use doc with ctx - never a clone of it! -- cgit v1.2.3