diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2015-04-07 13:49:31 +0200 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2015-04-07 13:35:08 +0100 |
commit | 0ccfd9c40b6790fca0f753e03b473b5f78ba97f9 (patch) | |
tree | 6dfc359cb0a88a4bc887672bf7048a6c5337d74e /platform/x11/x11_main.c | |
parent | b8eb55a488aa9dc6884e01b06e948faf1f83012d (diff) | |
download | mupdf-0ccfd9c40b6790fca0f753e03b473b5f78ba97f9.tar.xz |
Add EPUB layout options to mupdf-x11 and mudraw.
Diffstat (limited to 'platform/x11/x11_main.c')
-rw-r--r-- | platform/x11/x11_main.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/platform/x11/x11_main.c b/platform/x11/x11_main.c index 0da79469..80c86a23 100644 --- a/platform/x11/x11_main.c +++ b/platform/x11/x11_main.c @@ -798,10 +798,13 @@ static void signal_handler(int signal) static void usage(void) { fprintf(stderr, "usage: mupdf [options] file.pdf [page]\n"); - fprintf(stderr, "\t-b -\tset anti-aliasing quality in bits (0=off, 8=best)\n"); fprintf(stderr, "\t-p -\tpassword\n"); fprintf(stderr, "\t-r -\tresolution\n"); + fprintf(stderr, "\t-A -\tset anti-aliasing quality in bits (0=off, 8=best)\n"); fprintf(stderr, "\t-C -\tRRGGBB (tint color in hexadecimal syntax)\n"); + fprintf(stderr, "\t-W -\tpage width for EPUB layout\n"); + fprintf(stderr, "\t-H -\tpage height for EPUB layout\n"); + fprintf(stderr, "\t-S -\tfont size for EPUB layout\n"); exit(1); } @@ -822,8 +825,6 @@ int main(int argc, char **argv) struct timeval now; struct timeval *timeout; struct timeval tmo_advance_delay; - int tint = 0; - int tint_r, tint_g, tint_b; ctx = fz_new_context(NULL, NULL, FZ_STORE_DEFAULT); if (!ctx) @@ -832,20 +833,25 @@ int main(int argc, char **argv) exit(1); } - while ((c = fz_getopt(argc, argv, "p:r:b:C:")) != -1) + pdfapp_init(ctx, &gapp); + + while ((c = fz_getopt(argc, argv, "p:r:A:C:W:H:S:")) != -1) { switch (c) { case 'C': c = strtol(fz_optarg, NULL, 16); - tint = 1; - tint_r = (c >> 16) & 255; - tint_g = (c >> 8) & 255; - tint_b = (c) & 255; + gapp.tint = 1; + gapp.tint_r = (c >> 16) & 255; + gapp.tint_g = (c >> 8) & 255; + gapp.tint_b = (c) & 255; break; case 'p': password = fz_optarg; break; case 'r': resolution = atoi(fz_optarg); break; - case 'b': fz_set_aa_level(ctx, atoi(fz_optarg)); break; + case 'A': fz_set_aa_level(ctx, atoi(fz_optarg)); break; + case 'W': gapp.layout_w = fz_atof(fz_optarg); break; + case 'H': gapp.layout_h = fz_atof(fz_optarg); break; + case 'S': gapp.layout_em = fz_atof(fz_optarg); break; default: usage(); } } @@ -858,15 +864,6 @@ int main(int argc, char **argv) if (argc - fz_optind == 1) pageno = atoi(argv[fz_optind++]); - pdfapp_init(ctx, &gapp); - if (tint) - { - gapp.tint = tint; - gapp.tint_r = tint_r; - gapp.tint_g = tint_g; - gapp.tint_b = tint_b; - } - winopen(); if (resolution == -1) |