[Koha] jsprint setup + Receipt printing on Linux clients

Chad Roseburg croseburg at ncrl.org
Tue Apr 2 08:46:33 NZDT 2013


Thanks for all your input!

I had this feature working on a test server running the dev channel of Koha
maybe a month ago. It stopped working so, in frustration, I copied the code
from the Wiki. My previous code contained the single quotes and worked as
expected, but lacked the "try/catch" for falling back to normal printing if
jsPrint was not present. My point is that, with or without the single
quotes representing the 2nd argument, it is not working. Not working in
3.10 stable nor the latest packages for Debian. I thought maybe jsprint's
security settings were to blame, or possibly I'd run into a bug ...but it
could easily be the station I'm testing with. It sounds like the javascript
[ /w empty single quotes ] is correct so I will move on to other
possibilities.

@Randall
For many cases it's overkill, but there are scenarios where this would be
very handy.

1. Allows staff to use a single browser. Only Koha related pages print
silent to the receipt printer. Less confusion for substitutes and
techphobic staff members.
2. Centralized printer settings. Name every receipt printer "receipt", or
whatever, and you're done.
3. If you have Linux staff stations --- Firefox/Chrome do not use "Last
Used Printer", so your method does not work at all!
So this method allows easy, effortless and centralized receipt printer
setups for Debian/Ubu staff stations. I have not tried portable Firefox, so
that may be a way to get around the "Last Used Printer" issue, not sure.

Thanks again for your input! Would appreciate some guidance from other
libraries using staff Linux clients as to receipt setup.

Chad


On Mon, Apr 1, 2013 at 3:44 AM, Randall Rowe <r.rowe at lincolnlibraries.org>wrote:

> Chad,
>
> This is overkill. If everything you do from this browser is going to be
> silently printed to the same printer, simply set up your printer prefs in
> FireFox. Then go to the about:config page and add a new boolean called
> "print.always_print_silent" and set it to true.
>
> Randy
>
>
>
>
>
> ---- Original Message ----
> From: "Chad Roseburg" <croseburg at ncrl.org>
> Sent: 3/29/2013 3:30:56 PM
> To: koha at lists.katipo.co.nz
> Subject: [Koha] jsprint setup -
>
> I am trying to setup silent printing using the 'IntranetSlipPrinterJS' in
> Koha 3.10.
>
> Documentation found here:
>
> http://wiki.koha-community.org/wiki/Setting_up_slip_printer_to_print_silently
>
> My javascript looks like this:
> function printThenClose() {
>  try
>   {
>         jsPrintSetup.setPrinter('TSP143-(STR_T-001)');
>         jsPrintSetup.clearSilentPrint();
>         jsPrintSetup.setOption('printSilent', 1);
>
>  jsPrintSetup.setOption('headerStrLeft',);
>         jsPrintSetup.setOption('headerStrCenter',);
>         jsPrintSetup.setOption('headerStrRight',);
>         jsPrintSetup.setOption('footerStrLeft',);
>         jsPrintSetup.setOption('footerStrCenter',);
>         jsPrintSetup.setOption('footerStrRight',);
>         jsPrintSetup.print();
>   }
> catch(err)
>   {
>         //Default printing if jsPrint-setup is not available
>         window.print();
>         window.close();
>   }
> }
>
> Using Firefox 19 on Ubuntu 12.04.
>
> It brings up the receipt window but that's it. I've tried commenting out
> the setprinter line
> ...no change. JSprint addon is set to allow any site access. Tried other
> permissions to no avail. Does anyone have complete instructions for getting
> this to work?
>
> Thanks!
>
> --
> Chad Roseburg
> Automation Dept.
> North Central Regional Library
> _______________________________________________
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> http://lists.katipo.co.nz/mailman/listinfo/koha
>
>
>


-- 
Chad Roseburg
Automation Dept.
North Central Regional Library


More information about the Koha mailing list