Print Single PDF Page on Multiple Page Colors / Trays

Randy Parker randy.j.parker at gmail.com
Mon Oct 18 11:20:55 PDT 2010


How can I submit a single job to print a page on several colors of paper?

I want to print thousands of PDF page-sets from Ubuntu.  Each 'page-set' is a single page PDF, which is to be printed with a certain pattern of colored paper, say 'wpyyy' for White, Pink, Yellow, Yellow, Yellow.  Generally, I keep the same pattern of page-colors for a hundred page-sets or so before changing.  Each page-set has a different PDF.

I'm printing from a Ruby-on-Rails app, using a fork-and-exec "system" invocation of "lpr", because the Ruby CUPS bindings are not widely used.  There are two Ruby CUPS interfaces: an simple (ie 'incomplete') one from Chris Mowforth a couple of years ago, and much more comprehensive "ruby-cups-1.2" from Harald Grosse in 2002 that has little documentation, and does not readily compile on OSX.  I compiled it on Snow Leopard with a couple of little changes:
1) Edited the Makefile and changed 'i386-s'  to just 'i386'
2) Deleted the 'arch ppc' stuff in 3 places

How can I submit a single job to print a page on several colors of paper?
Using lpr seems to require a separate print job for each color, because you cannot use multiple "-o InputSlot" options in a single invocation:

lpr -P hp4515x -o InputSlot=Tray6 f.pdf -o InputSlot=Tray3 f.pdf

Does Not Work - it prints "f.pdf" twice on Tray3.

Sending separate print jobs for each page color causes my printer to "stall" for 4 or 5 seconds, reducing the output rate from 65ppm to 10ppm.

I'd really rather render the PDF only once on the printer, and somehow tell it to print the "wpyyy" page set.  Is there a way to do that in CUPS, without changing the driver's source?  Which features should I investigate?  (Assume I know which color paper is in which tray #).

Thank you,
- Randy







More information about the cups mailing list