[Poppler-bugs] [Bug 50914] New: pdfseparate - error checking for destFileName precludes use of valuable sprintf options

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Jun 9 08:01:32 PDT 2012


https://bugs.freedesktop.org/show_bug.cgi?id=50914

             Bug #: 50914
           Summary: pdfseparate - error checking for destFileName
                    precludes use of valuable sprintf options
    Classification: Unclassified
           Product: poppler
           Version: unspecified
          Platform: Other
        OS/Version: Linux (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: utils
        AssignedTo: poppler-bugs at lists.freedesktop.org
        ReportedBy: joe at mooring.com


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

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Poppler-bugs mailing list