summaryrefslogtreecommitdiff
path: root/source/tools/mudraw.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-04-07 13:49:31 +0200
committerRobin Watts <robin.watts@artifex.com>2015-04-07 13:35:08 +0100
commit0ccfd9c40b6790fca0f753e03b473b5f78ba97f9 (patch)
tree6dfc359cb0a88a4bc887672bf7048a6c5337d74e /source/tools/mudraw.c
parentb8eb55a488aa9dc6884e01b06e948faf1f83012d (diff)
downloadmupdf-0ccfd9c40b6790fca0f753e03b473b5f78ba97f9.tar.xz
Add EPUB layout options to mupdf-x11 and mudraw.
Diffstat (limited to 'source/tools/mudraw.c')
-rw-r--r--source/tools/mudraw.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/tools/mudraw.c b/source/tools/mudraw.c
index 8edcf381..75e32e5c 100644
--- a/source/tools/mudraw.c
+++ b/source/tools/mudraw.c
@@ -113,6 +113,10 @@ static int width = 0;
static int height = 0;
static int fit = 0;
+static float layout_w = 450;
+static float layout_h = 600;
+static float layout_em = 12;
+
static int showfeatures = 0;
static int showtime = 0;
static size_t memtrace_current = 0;
@@ -174,6 +178,10 @@ static void usage(void)
"\t-f -\tfit width and/or height exactly; ignore original aspect ratio\n"
"\t-B -\tmaximum bandheight (pgm, ppm, pam, png output only)\n"
"\n"
+ "\t-W -\tpage width for EPUB layout\n"
+ "\t-H -\tpage height for EPUB layout\n"
+ "\t-S -\tfont size for EPUB layout\n"
+ "\n"
"\t-c -\tcolorspace (mono, gray, grayalpha, rgb, rgba, cmyk, cmykalpha)\n"
"\t-G -\tapply gamma correction\n"
"\t-I\tinvert colors\n"
@@ -848,7 +856,7 @@ int main(int argc, char **argv)
fz_var(doc);
- while ((c = fz_getopt(argc, argv, "po:F:R:r:w:h:fB:c:G:I:s:A:Di")) != -1)
+ while ((c = fz_getopt(argc, argv, "po:F:R:r:w:h:fB:c:G:I:s:A:DiW:H:S:")) != -1)
{
switch (c)
{
@@ -870,6 +878,10 @@ int main(int argc, char **argv)
case 'G': gamma_value = atof(fz_optarg); break;
case 'I': invert++; break;
+ case 'W': layout_w = atof(fz_optarg); break;
+ case 'H': layout_h = atof(fz_optarg); break;
+ case 'S': layout_em = atof(fz_optarg); break;
+
case 's':
if (strchr(fz_optarg, 't')) ++showtime;
if (strchr(fz_optarg, 'm')) ++showmemory;
@@ -1060,6 +1072,8 @@ int main(int argc, char **argv)
fz_throw(ctx, FZ_ERROR_GENERIC, "cannot authenticate password: %s", filename);
}
+ fz_layout_document(ctx, doc, layout_w, layout_h, layout_em);
+
if (output_format == OUT_STEXT || output_format == OUT_TRACE)
fz_printf(ctx, out, "<document name=\"%s\">\n", filename);