thendal
Programmer
- Aug 23, 2000
- 284
Hi all!
Could some one help me in finding a good module for printing to a printer. I tried printer module from cpan. It doesn't have a good documentation. I would like to write a code in such a way irrespective of the OS it should pick up default printer and print the document. i tried the following code in MS .
use Printer;
$prn = new Printer('linux' => 'lp',
'MSWin32' => 'LPT1',
$OSNAME => 'Printer');
$prn->print_command('linux' => {'type' => 'pipe',
'command' => 'lpr -P lp'},
'MSWin32' => {'type' => 'command',
'command' => 'gswin32c -sDEVICE=mswinpr2
-dNOPAUSE -dBATCH $spoolfile'}
);
%available_printers = $prn->list_printers;
$prn->use_default;
$data="this is a Test";
$prn->print($data);
The above code gave me an error
Spool: C:\WINDOWS\TEMP\printer-28880.ps
'gswin32c' not recoginzed as external or internal command
Regards,
T
Could some one help me in finding a good module for printing to a printer. I tried printer module from cpan. It doesn't have a good documentation. I would like to write a code in such a way irrespective of the OS it should pick up default printer and print the document. i tried the following code in MS .
use Printer;
$prn = new Printer('linux' => 'lp',
'MSWin32' => 'LPT1',
$OSNAME => 'Printer');
$prn->print_command('linux' => {'type' => 'pipe',
'command' => 'lpr -P lp'},
'MSWin32' => {'type' => 'command',
'command' => 'gswin32c -sDEVICE=mswinpr2
-dNOPAUSE -dBATCH $spoolfile'}
);
%available_printers = $prn->list_printers;
$prn->use_default;
$data="this is a Test";
$prn->print($data);
The above code gave me an error
Spool: C:\WINDOWS\TEMP\printer-28880.ps
'gswin32c' not recoginzed as external or internal command
Regards,
T