One job- two prints

Post Reply
nortizt
Posts: 5
Joined: Mon Sep 19, 2016 8:06 am

One job- two prints

Post by nortizt »

Hello,

I have two canon Pixma IP 7250 connected to my RPI. I want to print one copy of an image through each of my printers. I understand I do not need to render the image twice, I could use a filter to send the "job" to the two printers.

Unfortunately I am not quite sure how I could do this or if it is possible.

Thank you for your help!
zedonet
Site Admin
Posts: 2156
Joined: Fri Oct 06, 2006 8:02 am

Re: One job- two prints

Post by zedonet »

Hello,

there are several ways to do this and creating a CUPS filter is a possible solution.

I'd create a new filter in /usr/lib/cups/filter that calls the existing TurboPrint filter and catches the printer output, then sends the print job to two print queues.
This would look like the following (the following is not tested and probably contains errors):

Code: Select all

#!/bin/bash
OLDFILTER=/usr/lib/cups/filter/pstoturboprint
if [ -z $6 ] ; then
	$OLDFILTER "$1" "$2" "$3" "$4" "$5" > /tmp/myprintjob
else
	$OLDFILTER "$1" "$2" "$3" "$4" "$5" "$6" > /tmp/myprintjob
fi
lp -d printqueue1 -o raw /tmp/myprintjob
lp -d printqueue2 -o raw /tmp/myprintjob
rm /tmp/myprintjob
Then you need to create a modified version of the printer PPD file /etc/cups/ppd/<printername>.ppd so that the new filter is called (replace every occurence of "pstoturboprint") and then set up a new print queue using lpadmin from a Terminal window

Code: Select all

sudo /usr/sbin/lpadmin -p <printername> -D <printerdescription> -v <printeruri> -P <mynewppd>
The URI can be found in TurboPrint Control, column "URI".
nortizt
Posts: 5
Joined: Mon Sep 19, 2016 8:06 am

Re: One job- two prints

Post by nortizt »

thank you for your help!!
Post Reply