diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2014-12-03 04:04:07 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2014-12-03 04:04:07 +0000 |
commit | af071407a1fdec8280ef74693c81c066725e9315 (patch) | |
tree | a7f75f83ec36f6f3eeddd150d0a463f57d3beb45 /Build/source | |
parent | 3f815afe9960fc390ce2322dbd9d933ee30b4d22 (diff) |
texk/dvipdfm-x/xbb.c: Support to specify a page to extract bounding box
git-svn-id: svn://tug.org/texlive/trunk@35728 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r-- | Build/source/texk/dvipdfm-x/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/xbb.c | 17 |
2 files changed, 20 insertions, 2 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index 909e0c79462..455440e9be7 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,3 +1,8 @@ +2014-12-03 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * xbb.c: Support to specify a page in a multi-page PDF to extract + bounding box, usage: extractbb -f page foo.pdf. + 2014-12-01 Karl Berry <karl@tug.org> * data/dvipdfmx.cfg (D): add back -sPAPERSIZE=a0, needed for diff --git a/Build/source/texk/dvipdfm-x/xbb.c b/Build/source/texk/dvipdfm-x/xbb.c index c8cb7868bc3..12d8002f315 100644 --- a/Build/source/texk/dvipdfm-x/xbb.c +++ b/Build/source/texk/dvipdfm-x/xbb.c @@ -43,6 +43,8 @@ #define XBB_PROGRAM "extractbb" +static long Include_Page = 1; + static void show_version(void) { fprintf (stdout, "\nThis is " XBB_PROGRAM " Version " VERSION "\n"); @@ -55,10 +57,11 @@ static void show_version(void) static void show_usage(void) { - fprintf (stdout, "\nUsage: " XBB_PROGRAM " [-q|-v] [-O] [-m|-x] FILE...\n"); + fprintf (stdout, "\nUsage: " XBB_PROGRAM " [-f page] [-q|-v] [-O] [-m|-x] FILE...\n"); fprintf (stdout, " " XBB_PROGRAM " --help|--version\n"); fprintf (stdout, "Extract bounding box from PDF, PNG, or JPEG file; default output below.\n"); fprintf (stdout, "\nOptions:\n"); + fprintf (stdout, " -f page\tSpecify a PDF page to extract bounding box\n"); fprintf (stdout, " -h | --help\tShow this help message and exit\n"); fprintf (stdout, " --version\tOutput version information and exit\n"); fprintf (stdout, " -q\t\tBe quiet\n"); @@ -234,7 +237,7 @@ static void do_pdf (FILE *fp, char *filename) { pdf_obj *page; pdf_file *pf; - long page_no = 1; + long page_no = Include_Page; long count; pdf_rect bbox; @@ -293,12 +296,22 @@ int extractbb (int argc, char *argv[]) case 'x': compat_mode = 0; break; + case 'q': + verbose = 0; + break; case 'v': verbose = 1; break; case 'h': show_usage(); exit (0); + case 'f': + argc--; + argv++; + Include_Page = atol (argv[0]); + if (Include_Page == 0) + Include_Page = 1; + break; default: fprintf (stderr, "Unknown option in \"%s\"", argv[0]); usage(); |