On Sat, 15 Feb 2014 21:11:57 +0000, Peter Flynn wrote:
> On 02/15/2014 07:51 PM, tlvp wrote:
>> On Wed, 08 Jan 2014 14:24:37 +0100, Wilfried proposed:
>>
>>> pdftk.exe in.pdf cat 1 3 5 7 9 11 12 10 8 6 4 2 output out.pdf
>>
>> That's a neat illustration how to use PDFTK to permute a few pages, thanks.
>>
>> How long a command of that sort can PDFTK -- or most systems -- handle?
>> We have PDFs for entire books that, for two-up duplex printing, we'd need
>> to permute all four-to-five hundred pages of, along these lines:
>>
>>: pdftk.exe in.pdf cat 2 3 4 1 6 7 8 5 10 11 12 9 ... 446 447 448 445 output out.pdf
>>
>> but we fear that might be too long a CL to succeed. Ideas, please? Thanks!
>
> The modern commandline on most Unix-derived systems (eg Mac OS X, Linux)
> can cope with lines much longer than your above would need. I don't know
> the limits, but I blew it once by trying to pass over 5,000 filenames.
> But I regularly build commands that would run to many thousands of
> characters. I have no idea what Windows can cope with, though.
Used to be that Windows had a 512-byte CL limitation (or was it 256-byte?).
May be better these days but I doubt it goes as far as 5k filenames :-) .
> But if you want to do imposition, why construct this kind of thing when
> ps2ps, psbook, and similar scripts can do it for you? I use them
> extensively for imposing PDFs to print 2-up, 4-up, 8-up etc.
Ignorance, primarily -- I wasn't aware of their existence/utility. Thanks
for pointing them out to me :-) !
It has dawned on me, though, that, in place of the single long-liner I'd
want to use on a, say 436-page book PDF, of the form
: pdftk.exe in.pdf cat 2 3 4 1 6 7 8 5 ... 434 435 436 433 output out.pdf
(with ellipsis filled explicitly in, of course), I could run this simpler
2-line script 436/4 = 109 times, all told, and achieve the same end:
: pdftk.exe in.pdf cat 5-436 2 3 4 1 output out.pdf
: ren out.pdf in.pdf
or
: pdftk.exe in.pdf cat 5-end 2 3 4 1 output out.pdf
: ren out.pdf in.pdf
Suddenly what seemed to call for pdftk wizardry has gotten reduced to
humdrum batch file house-keeping.
>
> ///Peter
Thanks, all, for being here as advisors and sounding board! Cheers, -- tlvp