summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-01-05 15:12:17 +0000
committerRobin Watts <robin.watts@artifex.com>2011-01-05 15:12:17 +0000
commitbf092e4b5ce4810eae3e8c6f54cec19bdf6d2c85 (patch)
tree0ef67e64b4abf218eecc562ff1198a5b04a98f90
parent1812e625ea98cfc0035f13b31b11b4e72ad15aca (diff)
downloadmupdf-bf092e4b5ce4810eae3e8c6f54cec19bdf6d2c85.tar.xz
Add rotate flag to pdfdraw.
-rw-r--r--apps/pdfdraw.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/pdfdraw.c b/apps/pdfdraw.c
index a8c2986c..e31fd016 100644
--- a/apps/pdfdraw.c
+++ b/apps/pdfdraw.c
@@ -13,6 +13,7 @@
char *output = NULL;
float resolution = 72;
+float rotation = 0;
int showxml = 0;
int showtext = 0;
@@ -53,6 +54,7 @@ static void usage(void)
"\t-x\tshow display list\n"
"\t-d\tdisable use of display list\n"
"\t-5\tshow md5 checksums\n"
+ "\t-R -\trotate clockwise by given number of degrees\n"
"\tpages\tcomma separated list of ranges\n");
exit(1);
}
@@ -157,6 +159,7 @@ static void drawpage(pdf_xref *xref, int pagenum)
ctm = fz_translate(0, -page->mediabox.y1);
ctm = fz_concat(ctm, fz_scale(zoom, -zoom));
ctm = fz_concat(ctm, fz_rotate(page->rotate));
+ ctm = fz_concat(ctm, fz_rotate(rotation));
bbox = fz_roundrect(fz_transformrect(ctm, page->mediabox));
/* TODO: banded rendering and multi-page ppm */
@@ -283,13 +286,14 @@ int main(int argc, char **argv)
fz_error error;
int c;
- while ((c = fz_getopt(argc, argv, "o:p:r:Aadgmtx5")) != -1)
+ while ((c = fz_getopt(argc, argv, "o:p:r:R:Aadgmtx5")) != -1)
{
switch (c)
{
case 'o': output = fz_optarg; break;
case 'p': password = fz_optarg; break;
case 'r': resolution = atof(fz_optarg); break;
+ case 'R': rotation = atof(fz_optarg); break;
case 'A': accelerate = 0; break;
case 'a': savealpha = 1; break;
case 'm': showtime++; break;