summaryrefslogtreecommitdiff
path: root/docs/example.c
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2013-07-14 15:52:08 +0200
committerSebastian Rasmussen <sebras@gmail.com>2013-07-26 01:58:56 +0200
commit13fea96f5290a7abd52611bb96c2486e2ecc2169 (patch)
tree3884657b6655f6bae2aae716cf55da7ab9500a24 /docs/example.c
parentcbf0c46d67df087483d577372a3c4cb43e670ac9 (diff)
downloadmupdf-13fea96f5290a7abd52611bb96c2486e2ecc2169.tar.xz
Update single- and multi-threaded example mupdf usage.
Diffstat (limited to 'docs/example.c')
-rw-r--r--docs/example.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/docs/example.c b/docs/example.c
index 1a21c200..cf7d0176 100644
--- a/docs/example.c
+++ b/docs/example.c
@@ -2,7 +2,11 @@
// Compile a debug build of mupdf, then compile and run this example:
//
-// gcc -g -o build/debug/example -Iinclude doc/example.c build/debug/lib*.a -lm
+// gcc -g -o build/debug/example -Iinclude docs/example.c \
+// build/debug/libmupdf.a build/debug/libmupdf-js-none.a \
+// build/debug/libfreetype.a build/debug/libjbig2dec.a \
+// build/debug/libjpeg.a build/debug/libopenjpeg.a \
+// build/debug/libz.a -lm
//
// build/debug/example /path/to/document.pdf 1 200 25
@@ -90,7 +94,7 @@ render(char *filename, int pagenumber, int zoom, int rotation)
int main(int argc, char **argv)
{
- char *filename = argv[1];
+ char *filename = argc >= 2 ? argv[1] : "";
int pagenumber = argc > 2 ? atoi(argv[2]) : 1;
int zoom = argc > 3 ? atoi(argv[3]) : 100;
int rotation = argc > 4 ? atoi(argv[4]) : 0;