How to print multiple files?

James Gray james.gray at dot.com.au
Tue Jun 17 20:55:34 UTC 2008


Dotan Cohen wrote:
> 2008/6/17 James Gray <james at gray.net.au>:
>> Certainly is possible :)  Install the package "psutils" and assuming
>> you have ghostscript installed, you can do this from the command line:
>>
>> for PDF in *.pdf
>> do
>> pdf2ps $PDF - | psnup -2 | lp
>> done
>>
>> That will find every PDF file in the current directory, convert the
>> PDF to Postscript, dump the result into "psnup" which will mash the
>> postscript into a "2-up" format, then finally hand the PostScript to
>> the default printer via "lp".  You may also replace "| lp" with ">
>> `basename $PDF .pdf`-2up.ps" (without the "") to create a Postscript
>> file in 2-up format for each PDF.
>>
>> If you'd prefer 4-up, replace "psnup -2" with "psnup -4".  Similarly,
>> if your printer can do duplex (double sided printing) you can tell it
>> to print both sides with "lp -o sides=two-sided-short-edge" instead of
>> plain old "lp".  If you'd prefer the 2-up converted documents back in
>> PDF format:
>>
>> for DOC in *-2up.ps
>> do
>> ps2pdf $DOC `basename $DOC .ps`
>> done
>>
>> HTH,
>>
>> James
>>
> 
> Thank you James. The script seems very flexible and I will certainly
> use it. Unfortunately, the question is asked of a female user who I
> have turned into a Kubuntu user, so she needs a way to print the files
> directly from Konqueror. I think that one can add a service menu for
> that, though. Thanks.

Ah - ok.  Have a look in the KDE printer setup.  I vaguely remember 
something about being able to define certain filters (such as 2-up etc) 
and then assigning it to a "new" printer that uses it by default (so you 
make a copy of the default printer, call it "2 Up PDF" for example, and 
make it use the filter by default).  I know I did something similar to 
what you need to do back in the KDE2 days but I'm not in front of an 
Ubuntu box to figure it out again :-/

HTH,

James
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3253 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.ubuntu.com/archives/kubuntu-users/attachments/20080618/ef4253ad/attachment.bin>


More information about the kubuntu-users mailing list