When using pdfseparate, if the first page number and the last page number are not equal, the destination file name is checked to make sure it includes %d. This error checking is far too restrictive -- it precludes the use of many useful sprintf format options. For example, I would like to separate a 100 page pdf file as follows: destination-001.pdf destination-002.pdf ... destination-099.pdf destination-100.pdf I should be able to use this standard sprintf syntax: pdfseparate source.pdf destination-%03d.pdf However, since destFileName does not contain %d, this command throws an error: "Error: 'file-%03d.pdf' must contain '%d' if more than one page should be extracted To work around this, I'm adding %%d to the end of the file name (to satisfy the error checking requirement), then renaming all the files afterwards: pdfseparate source.pdf destination-%03d.pdf.%%d Options: a) Refine the error checking to handle all sprintf format options b) Remove the error checking
Nice idea! Feel free to implement and upload a patch fot it!
Created attachment 85930 [details] [review] allow zero-padded pagespecs This is a pretty dumb patch that enables the use of %01d, %02d, ... up to %09d. If you have a billion-page PDF it won't let you zero-pad it properly :P It doesn't change the current default non-zero-padded behavior of %d (i don't know if anyone is relying on that) and it doesn't auto-detect what the size of the zero-padding should be. The patch was written to apply to 0.22-5, i think.
Looks, ok to me. Thomas, what's your opinion?
(In reply to comment #3) > Looks, ok to me. Thomas, what's your opinion? Looks ok for me, too!
Commited, will be available in poppler 0.26 Thanks for your patience :-)
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.