[cups.general] Manual Duplex Printing in General

Gene Heskett gene.heskett at verizon.net
Sat Oct 30 09:00:29 PDT 2004


On Saturday 30 October 2004 07:38, Anonymous wrote:
>Hi All,
>
>I'm manually trying to do duplex printing over a network to a server
> running CUPS connected to a HP2550L Colour Laserjet.
>
>I can enable the duplexing options, and I can get options to do
> duplex in Windows, but when I try to print with duplexing truned on
> it just tells me there's been an error.
>
>I've tried manually printing a ps file with duplexing turned on, but
> nothing at all comes out of the printer so it's failing at the
> server end.
>
>I've heard that CUPS doesn't do manual duplexing - is this true?
>
>Thanks a lot,
>
>David

I think this is true David.  However there are many other front
ends and interfaces in the average linux install that do.
Acroread for instance allows you to print only the even or odd
pages, as does kghostview which uses kprinter if you are running
kde.  One of them, and I forget which one, will skip any embedded
images in the output that are in the .pdf docs for linuxCNC's emc
program.

xpdf does not do duplex, and gimp-print/gutenprint doesn't either.
As xpdf is one of the better renderers we have, that lack surprises
me a bit at this late date.

Ghostscript itself can be made to do individual numbered page
files to disk, and a bash script could be written to sequence
those to the -o raw version of the printer.  I did that years ago,
using an arexx script I'd written on the amiga and printed the whole
PLRM V1.2 manual, 408 pages to an old original epson stylus pro,
took about 5 days on that old slow workhorse. :(

From the ghostscript man page:
       -sOutputFile=foo%d.xyz

       Each resulting file receives one page of output, and the files are num-
       bered in sequence.  "%d" is a printf format specification; you can also
       use a variant like "%02d".


You would run gs from the cli with a command somewhat like this:
First cd to your scratchpad directory
#>cd /tmp
then
#>gs -dDEVICE -sOutputFile=NameOfFile.%03d /path/to/NameOfFile.[ps/pdf]

you can adjust the %03 according to the number of pages in the file,
which for a pdf can be known ahead of time by inspecting it with xdpf
or acroread, and this is a printf spec, so you'll get files named
NameOfFile.001. NameOfFile.002 etc with the above command.  If you
leave out the 03, then leadng zeros aren't used.  My amiga script
demanded its use or it would count 1 11 12 13 14 15 16 17 18 19 2
20 21 22 23 24 25 26 27 28 29 3 30 etc in the output sequence to
the printer.

Ymmv of course when using bash to do the script.

Another thing I had to do with several of my printers was to toss
any of those output files what were less than about 75 bytes in length.
Those were blank pages, which was all the commands to put the printer
into its desired gfx mode, and back out to plain text, followed by FF,
and many modern printers will NOT feed a page if they are already
at TOF.  So I threw away that file and subbed another 2 byte file
which had a linefeed to get the printer off of TOF, and then the FF
to spit out the blank page, thereby preserveing the intentionally
blank pages in the input file, and preserving my sanity when doing
duplex printing, lost when the pages got out of order on the two
sides of the paper.

It worked, but nowadays we have gui's that can do that for us. :)
I also think this 'bug/feature' in gs has been fixed for a while now.

But, I'll give Mike Sweet the last word on that.  Mike?

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
99.28% setiathome rank, not too shabby for a WV hillbilly
Yahoo.com attorneys please note, additions to this message
by Gene Heskett are:
Copyright 2004 by Maurice Eugene Heskett, all rights reserved.





More information about the cups mailing list