summaryrefslogtreecommitdiff
path: root/apps/unix/x11pdf.c
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@hotmail.com>2009-07-08 10:04:56 +0200
committerSebastian Rasmussen <sebras@hotmail.com>2009-07-08 10:04:56 +0200
commit2119d919cce7ab602b901fb24587a5555f43208a (patch)
tree29ce695a2ec44c517465d4c66e17a91dd2644604 /apps/unix/x11pdf.c
parente0fa7cceeddaba465bff90dce344c0c58b39779a (diff)
downloadmupdf-2119d919cce7ab602b901fb24587a5555f43208a.tar.xz
Let the command-line argument for mupdf be a percentage instead of a factor.
Diffstat (limited to 'apps/unix/x11pdf.c')
-rw-r--r--apps/unix/x11pdf.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/apps/unix/x11pdf.c b/apps/unix/x11pdf.c
index 28409c3f..e3bc4b72 100644
--- a/apps/unix/x11pdf.c
+++ b/apps/unix/x11pdf.c
@@ -456,7 +456,7 @@ static void onmouse(int x, int y, int btn, int modifiers, int state)
static void usage(void)
{
- fprintf(stderr, "usage: mupdf [-d password] [-z zoom] [-p pagenumber] file.pdf\n");
+ fprintf(stderr, "usage: mupdf [-d password] [-z zoom%%] [-p pagenumber] file.pdf\n");
exit(1);
}
@@ -511,7 +511,7 @@ int main(int argc, char **argv)
KeySym keysym;
int oldx = 0;
int oldy = 0;
- double zoom = 1.0;
+ int zoom = 100;
int pageno = 1;
int wasshowingpage;
struct timeval tmo, tmo_at;
@@ -521,12 +521,17 @@ int main(int argc, char **argv)
switch (c)
{
case 'd': password = fz_optarg; break;
- case 'z': zoom = atof(fz_optarg); break;
+ case 'z': zoom = atoi(fz_optarg); break;
case 'p': pageno = atoi(fz_optarg); break;
default: usage();
}
}
+ if (zoom < 100)
+ zoom = 100;
+ if (zoom > 300)
+ zoom = 300;
+
if (argc - fz_optind == 0)
usage();
@@ -540,7 +545,7 @@ int main(int argc, char **argv)
pdfapp_init(&gapp);
gapp.scrw = DisplayWidth(xdpy, xscr);
gapp.scrh = DisplayHeight(xdpy, xscr);
- gapp.zoom = zoom;
+ gapp.zoom = zoom / 100.0;
gapp.pageno = pageno;
pdfapp_open(&gapp, filename);