Bug 72720 - pdfunite of a single file should not fail
Summary: pdfunite of a single file should not fail
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium enhancement
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-15 02:16 UTC by Marc Donner
Modified: 2013-12-17 23:46 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Marc Donner 2013-12-15 02:16:01 UTC
I have a large document (circa 1,000 pages) that I have used pdfseparate to break into individual pages and that I am then using pdfunite to combine into useful bundles of pages.  Some of the bundles are comprised of a single page.

I manage the bundle creation process using a set of data objects, so the basic inner loop goes something like this:

pdfunite ${SOURCE_LIST} ${DESTINATION_FILE}

If ${SOURCE_LIST} happens to contain a single PDF file, then pdfunite whines and refuses to work, so I've had to special case these items and make the command be cp instead of pdfunite.

I argue that for clean closure pdfunite source.pdf dest.pdf should copy source.pdf to dest.pdf

If the poppler community agrees that this is a valid proposal, I'd be happy to submit a change list to implement the fix.
Comment 1 Albert Astals Cid 2013-12-15 14:58:29 UTC
Honestly, i don't think it makes sense, i'll let others comment.
Comment 2 Thomas Freitag 2013-12-16 08:29:39 UTC
I don't think it amkes sense, too. But if it would make anybody happy to change

if (!ok || argc <= 3 || printVersion || printHelp)

to

if (!ok || argc < 3 || printVersion || printHelp)

why not? Then You can use pdfunite also to try to repair defect single page PDF files :-)
Comment 3 Albert Astals Cid 2013-12-16 21:20:53 UTC
Is that the only change needed for it to work?
Comment 4 Thomas Freitag 2013-12-17 09:12:46 UTC
(In reply to comment #3)
> Is that the only change needed for it to work?

Sure, that's it (Just checked to assure it :-) )
Comment 5 Thomas Freitag 2013-12-17 09:18:28 UTC
But be aware: If someone just forget to give the output filename, the last file will always be overwritten (but this happens also in the past if someone gives more than two filenames which should be merged and doesn't give the output file)!
Comment 6 Albert Astals Cid 2013-12-17 23:46:41 UTC
Ok, will be in 0.25.1


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.