carson
carson

Reputation: 11

make an lp script into functioning printer

I'm trying to print to separate printers simultaneously in Ubuntu 14.04 From all of my reading the best option I've seen is to write a script that sends an lp command to the separate printers.

This is the script I've written so far

!/bin/bash

lp -d printer "$@"

lp -d printer2 "$@"

where printer and printer 2 are the actual printers installed on the system This script works from a terminal, however I would like to be able to send print jobs directly to a "printer" that is actually the script I've written.

How can I make this lp script into a "printer"

Upvotes: 0

Views: 1017

Answers (1)

carson
carson

Reputation: 11

Ok I didn't find a way to do this the way I originally intended, however it is possible with tea4CUPS

great cups backend tool with an easy config file http://www.pykota.com/software/tea4cups/download

The install instructions are on the download page.

As for printing to multiple printers, add this command in the config file for every printer you wish to print to.

prehook_firstprinter: /usr/bin/lp -d Name of Printer -o raw $TEADATAFILE

Here are the simplest instructions I could write 1. download the tea4cups.gz

  1. Extract it to the home folder, rename it to tea4cups

  2. Open a terminal and run these commands

sudo cp /home/manifester/tea4cups/tea4cups.conf /etc/cups

sudo cp /home/manifester/tea4cups/tea4cups /usr/lib/cups/backend/

sudo chmod 700 /usr/lib/cups/backend/tea4cups

  1. Run this command

sudo gedit /etc/cups/tea4cups.conf

  1. Paste this in the bottom of the document

prehook_firstprinter: /usr/bin/lp -d Name of Printer yes the literal name in the printer window -o raw $TEADATAFILE

  1. you will need a new line for every printer you have, so if you want to print to 3 printers you will need three of the above line each having the name of the printer it will be talking to.

  2. save and close everything

  3. open a terminal and run

sudo service cups restart

  1. open a web browser and go to the browser cups controller

http://localhost:631/admin

  1. go to Add Printer

  2. you should see a printer named "tea4CUPSnothing"

If you don't see it go back and press "Find Printers" it should be there

  1. Change the info of the printer to "Print all" for all type fields"

  2. Press Continue

  3. The generic printer driver works because the printer doesn't actually exist.

  4. Press Continue

  5. Set Defaults

  6. you should be done, go to your printer window on ubuntu and do a test print.

Upvotes: 1

Related Questions