diff options
author | Robin Watts <robin.watts@artifex.com> | 2013-05-16 17:03:29 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-05-16 18:54:48 +0100 |
commit | 5157d7cac960316e76ac408d1f6ec1d24867bdb7 (patch) | |
tree | 994b30b4256b6298d5ec8314a2bea8ba9f1799b3 /apps | |
parent | d7a79bb7a88abfca9b1e0bc79703951f5a1e4bc5 (diff) | |
download | mupdf-5157d7cac960316e76ac408d1f6ec1d24867bdb7.tar.xz |
Add PWG raster output to mudraw.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/mudraw.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/mudraw.c b/apps/mudraw.c index efc06f25..dac5f42e 100644 --- a/apps/mudraw.c +++ b/apps/mudraw.c @@ -12,7 +12,7 @@ enum { TEXT_PLAIN = 1, TEXT_HTML = 2, TEXT_XML = 3 }; -enum { OUT_PNG, OUT_PPM, OUT_PNM, OUT_PAM, OUT_PGM, OUT_PBM, OUT_SVG }; +enum { OUT_PNG, OUT_PPM, OUT_PNM, OUT_PAM, OUT_PGM, OUT_PBM, OUT_SVG, OUT_PWG }; typedef struct { @@ -29,6 +29,7 @@ static const suffix_t suffix_table[] = { ".pam", OUT_PAM }, { ".pbm", OUT_PBM }, { ".svg", OUT_SVG }, + { ".pwg", OUT_PWG }, }; /* @@ -102,6 +103,7 @@ static int fit = 0; static int errored = 0; static int ignore_errors = 0; static int output_format; +static int append = 0; static fz_text_sheet *sheet = NULL; static fz_colorspace *colorspace; @@ -577,6 +579,13 @@ static void drawpage(fz_context *ctx, fz_document *doc, int pagenum) fz_write_pam(ctx, pix, buf, savealpha); else if (output_format == OUT_PNG) fz_write_png(ctx, pix, buf, savealpha); + else if (output_format == OUT_PWG) + { + if (strstr(output, "%d") != NULL) + append = 0; + fz_write_pwg(ctx, pix, buf, append); + append = 1; + } else if (output_format == OUT_PBM) { fz_bitmap *bit = fz_halftone_pixmap(ctx, pix, NULL); fz_write_pbm(ctx, bit, buf); |