'pdfseparate': Format output file name as page number with leading zeroes
Asked Answered
P

1

7

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?

Parsaye answered 9/12, 2015 at 6:16 Comment(1)
Which version of Poppler/pdfseparate are you using?Nea
N
17

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
Nea answered 23/3, 2016 at 18:40 Comment(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. askubuntu.com/questions/722950/…Parsaye

© 2022 - 2024 — McMap. All rights reserved.