6

pdfseparate requires to specify %d as PDF-page-pattern which is replaced by the page number.

$ pdfseparate CFL_1115_ISSUU.pdf cfl-%d.pdf works. It sets separated output file names as cfl-1.pdf, cfl-2.pdf, ..., cfl-10.pdf etc.

Now I need to add leading 0 to fix the file name string length. So when I try to use formatting characters in command $ pdfseparate CFL_1115_ISSUU.pdf cfl-%04d.pdf, it gives error Syntax Error: 'cfl-%04d.pdf' must contain '%d' if more than one page should be extracted

Can anybody suggest if such formatting is possible?

Kurt Pfeifle
  • 86,724
  • 23
  • 248
  • 345
Amit Patel
  • 15,609
  • 18
  • 68
  • 106

1 Answers1

16

On my system (Mac OS X), using the most recent version of Poppler, v0.42.0, this command works as expected:

$ pdfseparate -l 10 PDF32000_2008.pdf cfl-%04d.pdf

$ ls -l cfl-*.pdf
-rw-r--r--  1  kp   staff    11475 23 Mär 18:58 cfl-0001.pdf
-rw-r--r--  1  kp   staff    91252 23 Mär 18:58 cfl-0002.pdf
-rw-r--r--  1  kp   staff  8334441 23 Mär 18:58 cfl-0003.pdf
-rw-r--r--  1  kp   staff  8334443 23 Mär 18:58 cfl-0004.pdf
-rw-r--r--  1  kp   staff  8334444 23 Mär 18:58 cfl-0005.pdf
-rw-r--r--  1  kp   staff    93209 23 Mär 18:58 cfl-0006.pdf
-rw-r--r--  1  kp   staff    89540 23 Mär 18:58 cfl-0007.pdf
-rw-r--r--  1  kp   staff    64383 23 Mär 18:58 cfl-0008.pdf
-rw-r--r--  1  kp   staff  8334444 23 Mär 18:58 cfl-0009.pdf
-rw-r--r--  1  kp   staff   116229 23 Mär 18:58 cfl-0010.pdf
Kurt Pfeifle
  • 86,724
  • 23
  • 248
  • 345
  • 1
    Thanks. I was using 0.25 on Ubuntu 14.04 LTS. I have to upgrade to Ubuntu 15.x to fix issue I am getting up update poppler to 0.43. http://askubuntu.com/questions/722950/how-to-upgrade-poppler-utils-to-latest-version – Amit Patel Mar 28 '16 at 07:36