Koha How-To

Setting up Receipt Printers on Ubuntu for Koha

Today a tutorial from one of our newest partners, Sean Park at the Coos County Libraries. A message came across our mailing list asking the following:

We are new to Koha and ByWater, and everything is great so far. But we’ve have some trouble with our old receipt printers that we used under TLC. I think they are Bixolon printers, SPR 350’s, that connect through USB. I have played with some drivers that make them work a little bit, but don’t want to fight with them for months and months, or to have to search for some obscure driver to make them work. We are using Koha in the Ubuntu desktop on our staff machines, and I wondered if anyone else used Koha on linux machines, and what receipt printers worked best for them? I’d be happy to just replace our old receipt printers, as I only need 3 of them. I welcome any advice!

And Sean replied:

This morning I finished setting up new Star TSP100 (TSP143LAN) thermal receipt printers in anticipation of our migration in a few weeks. Coupled with the JSPrintSetup add-on in Firefox they are automatically printing receipts with no popup dialog, and setup was quite easy. We’re on Ubuntu 12.04. If you’d like instructions for installing Star drivers, just let me know.

So, of course I asked him to share those instructions with us all. Here are Sean’s instructions for setting up Star TSP100 (TSP143LAN) receipt printers on Ubuntu 12.04:

  1. At the command line type:

    [code wraplines=”true” toolbar=”true”]
    sudo apt-get install libcups2-dev libcupsimage2-dev
    cd /tmp
    wget http://www.starmicronics.com/support/DriverFolder/drvr/starcupsdrv-3.4.0_linux_20121210.tar.gz
    tar -xzf starcupsdrv-3.4.0_linux_20121210.tar.gz
    cd starcupsdrv-3.4.0_linux/SourceCode
    tar -xzf starcupsdrv-src-3.4.0.tar.gz
    cd starcupsdrv/
    make
    sudo make install
    [/code]

  2. Install the JSPrintSetup add-on in Firefox and add your Koha staff URL to the list of allowed sites in JSPrintSetup preferences.
  3. In Koha preferences enter the following in the IntranetSlipPrinterJS field (tailor to your needs, this is what our TSP100’s use):

    [code language=”javascript” wraplines=”true” toolbar=”true”]
    function printThenClose() {
    try
    {
    jsPrintSetup.clearSilentPrint();
    jsPrintSetup.setOption(‘printSilent’, 1);
    //Set Header and footer
    jsPrintSetup.setOption(‘headerStrLeft’, ”);
    jsPrintSetup.setOption(‘headerStrCenter’, ”);
    jsPrintSetup.setOption(‘headerStrRight’, ”);
    jsPrintSetup.setOption(‘footerStrLeft’, ”);
    jsPrintSetup.setOption(‘footerStrCenter’, ”);
    jsPrintSetup.setOption(‘footerStrRight’, ”);
    //Set margins
    jsPrintSetup.setOption(‘marginTop’, 0);
    jsPrintSetup.setOption(‘marginBottom’, 2);
    jsPrintSetup.setOption(‘marginLeft’, 1);
    jsPrintSetup.setOption(‘marginRight’, 1);
    jsPrintSetup.print();
    window.close();
    }
    catch(err)
    {
    //Default printing if jsPrintsetup is not available
    window.print();
    window.close();
    }
    }
    [/code]

  4. Edit your slips in Koha “notices & slips“. Eg. our quick slip looks like this:

    [code wraplines=”true” toolbar=”true”]
    <img src="http://www.cooslibraries.org/screens/lilc.png" />
    <h3>Coastline Libraries – Coos County</h3><br />
    <checkedout>
    <<biblio.title>><br />
    <h3>Date due: <<issues.date_due>></h3><br />
    Checked out from: <<branches.branchname>> Library<br />
    Checked out to: <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
    Checked out on: <<today>><br />
    </checkedout>
    <br />
    Thank you for using Coastline Libraries!
    <!– end slip –>
    [/code]