5.2 - Cups Printer

Setting up a Cups method printer

Useful For: Fullpage Printing / Label Printing / Receipt Printing

Limitations: Requires a temp folder to print properly, and requires the package html2ps to print fullpage printouts.

It is important to make sure that if you plan to print fullpage printouts to a cups printer you have the package html2ps installed.

Install htmldoc

This method uses htmldoc functions, so you'll need to have htmldoc installed. To do this in most linux distrubitions simply run the command:



sudo apt-get install htmldoc

and the software will install.

 

Install the printer

This example will assume you are installing a Ethernet capable Hp laserjet 4 printer.

  1. Browse to https://10.10.2.10:631/ to get to the cups control panel. Depending on the cups install, you may be asked for your password immidately, or later on in the process. If a password prompt comes up, enter you Ubuntu Username and Password.
  2. Across the top click “Administration” then click “Add Printer”

  1. Choose “AppSocketHP JetDirect” and click “Continue”

  1. In the connection type socket://<ip>:<port> for example, our printer is at 10.10.2.35 and because it’s a standard print server we know the port is 9100. So we use socket://10.10.2.35:9100
  1. Next we set up the name, description and location of the printer. When choosing a name, it is important to choose a printer name that has no spaces or special characters. We will often use the simplified name Kiosk1 or Reg1 and set the rest of the printers up as Kiosk2 Kiosk2 etc.

  1. Next we find our printer, starting with choosing HP from the list and clicking Continue.

  1. Now we look for our specific model of HP printer and click Continue

  1. Next we set the default printer options for the printer. Make sure to set your page size, this is especially important if this is a card printer or a label printer.

  1. When the wizard finishes you should be brought to the control panel page of the printer.

  1. You can test print by pulling down the maintenance pulldown and choosing “Print test page”



Set up the printer in Convention Master

  1. One important step for Cups printers is to set up a temporary folder that the files can be written to.
  1. Log into the console of your server through either ssh or directly.
  1. If the folder /srv/www/tmp/ does not exist
  1. Run the mkdir command to make it


mkdir /srv/www/tmp
  1. Now set that folder world-writable using the chmod command:


chmod 777 /srv/www/tmp/
  1. Make a temp folder for this specific printer


mkdir /srv/www/tmp/kiosk1
  1. Now set that folder world-writable using the chmod command:


chmod 777 /srv/www/tmp/kiosk1/
  1. To intall the cups printers in convention master access your convention master console by browsing to http://10.10.2.10/console/
  1. Click on “Admin – Printing” then “Manage Printers

Manage Printers Screen

  1. In the upper left of the manage printer screen you can add your printer. If this is not the first printer you have set up, you may need to click the “Add Printer” button first. Then set the following settings:  Do this by setting the following:
    1. Printer Name – This is the name you want to assign the printer.
    2. Method – Choose Cups
    3. Path – <Cups Printer name>:<Path to tmp folder> where Cups printer name is the printer name as you have called it in cups (Case sensitive) and the Path to tmp folder is the path you just created. For example for our example printer the path would be Kiosk1:/srv/www/tmp/kiosk1/  The trailing slash is very important!
  2. Click Add
  3. Once set up you should see your entries in the Printers table and they should look like this:

Cups printing set up for Kiosk1&2

 

Also note, that if you hover over the url string for the printer path. A popup will appear telling you the path to the temp folder.

Test the printer

To test the printer functionality, add the printer to a printer pool and then use the Pool testing section. Read the Setting up printer pools section of this manual to perform the tests.

Troubleshooting Cups Printers

  • Use cups itself:  The fisrst way to troubleshoot a cups printer is to use the ‘print test page’ from the cups administration panel itself, located at https://10.10.2.10:631/
  • Check the temp folder: The second way to troubleshoot a print job, is to watch the contents of the temp folder. If the convention master system is sending print jobs, you should see temp files appear in that folder.
  • Check to see if the .ps file can be made: Before the file is sent to the printer, there is a .ps file that is made. The failure to render this ps file might be the cause of your issues. To try to make this ps file, run the following command:
    
    
    htmldoc --webpage --header ' ' --footer ' ' --fontsize 10 --left 0.5in --right 0.5in --top 0.5in --bottom 0.5in -f test.ps "http://www.google.com"
  • Try sending the print command yourself: From the command line, switch into the temp folder you have designated from the printer and try running the command on one of the temp files. See if any errors come up.

The command that civetprint uses to send the print jobs is:



lp –d <printer_name> <file>

Or for images



lp –d <printer_name> -o fitplot <file>