[Jsprintsetup] Problem using a specific printer

Dimitar Angelov mitko at edabg.com
Fri Nov 6 02:08:04 PST 2009


Hi Kostas!

The extension probably can't select desired printer, but I can't point 
exact reason.
You can turn on DEBUG option to see 'silent' reported errors if there are.
You can try this:

function pp_printPage() {
   var printername = "CUPS/thermal";
   jsPrintSetup.setGlobalOption('DEBUG', 1);
   // set printer name
   // If there is error, it will be reported
   jsPrintSetup.setPrinter(printername);

   // check current printer
   alert('getPrinter:'+jsPrintSetup.getPrinter()); // get current 
jsPrinSetup printer
   alert('getOption:'+jsPrintSetup.getOption('printerName')); // get 
printer setings service printer name
  ....
}

If there are errors reported or check of current printer display 
different results there is something wrong.

Please inform me about result.

Best Regards,

Dimitar Angelov

Kostas Fatolas wrote:
> Hello,
> 
> I have just installed your plugin for a project of mine.
> My problem is that I have not been able to instruct firefox to use a 
> specific printer.
> 
> First of all I use *jsPrintSetup.getPrintersList()* to get the list of 
> printers (this works fine).
> Then I use the following code with /'printername'/ one of the above.
> 
> Though it does not complain, each time it sends the document to my 
> default printer rather than the one I choose with *setPrinter()*.
> 
> I would appreciate any help on this!
> 
> My system is:
> 
>     /Linux 2.6.30-gentoo-r8 #1 SMP Mon Nov 2 11:35:30 EET 2009 i686
>     Intel(R) Core(TM)2 CPU 6400 @ 2.13GHz GenuineIntel GNU/Linux/
> 
> Firefox version is 3.5.4
> 
> Regards,
> 
> Kostas.
> 
>     function pp_printPage() {
>         var printername = "CUPS/thermal";
> 
>         // set printer name
>         jsPrintSetup.setPrinter(printername);
> 
>         // set orientation
>         jsPrintSetup.setOption('orientation',
>     jsPrintSetup.kPortraitOrientation);
> 
>         // set empty page header
>         jsPrintSetup.setOption('headerStrLeft', '');
>         jsPrintSetup.setOption('headerStrCenter', '');
>         jsPrintSetup.setOption('headerStrRight', '');
>         // set empty page footer
>         jsPrintSetup.setOption('footerStrLeft', '');
>         jsPrintSetup.setOption('footerStrCenter', '');
>         jsPrintSetup.setOption('footerStrRight', '');
> 
>         // Suppress print dialog (for this context only)
>         jsPrintSetup.clearSilentPrint();
>         jsPrintSetup.setOption('printSilent', 1);
> 
>         // Do Print
>         jsPrintSetup.print();
> 
>         jsPrintSetup.setOption('printSilent', 0);
>     };
> 


More information about the Jsprintsetup mailing list