summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2014-04-01 17:10:02 +0200
committerTor Andersson <tor.andersson@artifex.com>2014-04-02 14:16:21 +0200
commit3fa5683ad391f478e77bd69891ef12b2abb29928 (patch)
tree6c781b78a6436881a796a9fdd795b9261151205a /docs
parent30daa4f77e2c1f07fbca59b37ff07b4b642a4ebc (diff)
downloadmupdf-3fa5683ad391f478e77bd69891ef12b2abb29928.tar.xz
Update examples.
Diffstat (limited to 'docs')
-rw-r--r--docs/example.c6
-rw-r--r--docs/multi-threaded.c6
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!