Re: Printing a text file
On 30 Mar 2004 at 2:44, [EMAIL PROTECTED] wrote: > Hmm - does this still work with modern GDI printers which rely on > graphics output only and cannot cope with text sent straight from DOS > (eg. the most common Epson inkjets now available)?? I'm going to hazard a guess and say yes. My thinking is that by using "/device" Windows runs the print through the print driver and spooler. The other techniques mention, lpr and copying to the printer, are for non-binary prints, such as text files containing raw ASCII or PCL. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Printing a text file
On 29 Mar 2004 at 16:43, Peter Eisengrein wrote: > open(PRINTER,"| lpr -S server -P printer"); > print PRINTER $data; > > or use it as a system() call. Or a third option: $return = `lpr -S $printserver -P $printer -o l $printfile`; This allows you to check the output of the lpr command. If it ran into trouble you can fire off an lpq, or a traceroute, or loop and try again. Our printing "network" is spread out over three states so we have a tone of error handling/diagnostics in the print routine. Gotta love common code. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Printing a text file
In a message dated 29/03/2004 19:46:37 GMT Daylight Time, [EMAIL PROTECTED] writes: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\>print /? Prints a text file. PRINT [/D:device] [[drive:][path]filename[...]] /D:device Specifies a print device. Hmm - does this still work with modern GDI printers which rely on graphics output only and cannot cope with text sent straight from DOS (eg. the most common Epson inkjets now available)?? > -Original Message- > From: Hugh Loebner [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 29, 2004 12:03 PM > To: [EMAIL PROTECTED] > Subject: Printing a text file > > > Hello All, > > I can get perl to write a text file 'xyz.txt' to disk with no > problem, but I > don't know how to actually get my preferred printer to > actually print it out. > > Now I manually drag the file(s) to the printer icon which > invokes notepad, and > the files print fine. > > Ultimately, I'd like to directly control the printer, but in > the meantime, I'd > be happy to simply direct notepad to print them. > > Is there a simple command to do this, eg something like > > system notepad 'xyz.txt', print > > Hugh Loebner --Rich Mellor RWAP Services35 Chantry Croft, Kinsley, Pontefract, West Yorkshire, WF9 5JHTEL: 01977 610509Visit our website at URL:http://www.rwapsoftware.co.ukStuck with ordinary dial up internet connection ?? Read our review of internet accelerators and broadband at:URL: http://www.rwapadventures.com/Services/reviews.html ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Printing a text file
Hi Peter, The command: system ">print temp.txt" prints, but only to the screen. I can not get the command: PRINT [/D:device] [[drive:][path]filename[...]] to work. Going to the Control Panel for 'printers and other hardware' I get Properties Gestetner 2212 RPCS location blank Port 'Gestetner 2212' Description: Standard TCP/IP Port (I know the IP address, if that helps) Sharing Share name: Printer3 The command: system "PRINT temp.txt" produces: C:\Folder\temp.txt is currently being printed,' but nothing comes out of the printer. Opening the printer icon does not show any queued files. The command: system "PRINT /D:Printer3 temp.txt" produces: 'Unable to initialize device Printer 3' I'm using Windows XP professional. HL --- Peter Eisengrein <[EMAIL PROTECTED]> wrote: > Microsoft Windows XP [Version 5.1.2600] > (C) Copyright 1985-2001 Microsoft Corp. > > C:\>print /? > Prints a text file. > > PRINT [/D:device] [[drive:][path]filename[...]] > >/D:device Specifies a print device. > > > > > > -Original Message- > > From: Hugh Loebner [mailto:[EMAIL PROTECTED] > > Sent: Monday, March 29, 2004 12:03 PM > > To: [EMAIL PROTECTED] > > Subject: Printing a text file > > > > > > Hello All, > > > > I can get perl to write a text file 'xyz.txt' to disk with no > > problem, but I > > don't know how to actually get my preferred printer to > > actually print it out. > > > > Now I manually drag the file(s) to the printer icon which > > invokes notepad, and > > the files print fine. > > > > Ultimately, I'd like to directly control the printer, but in > > the meantime, I'd > > be happy to simply direct notepad to print them. > > > > Is there a simple command to do this, eg something like > > > > system notepad 'xyz.txt', print > > > > Hugh Loebner > > > > > > > > > > ___ > > Perl-Win32-Users mailing list > > [EMAIL PROTECTED] > > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > > > ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Printing a text file
> On 29 Mar 2004 at 9:03, Hugh Loebner wrote: > > > I can get perl to write a text file 'xyz.txt' to disk with > no problem, > > but I don't know how to actually get my preferred printer > to actually > > print it out. > > Peter has already mentioned using the windows "Print" command. > Depending on your situation you might also look at the windows "LPR" > command which prints to network-attached printers. We use the later > extensively. Another option, if the printer is on the network with a UNC name, you can usually just copy the file to it, such as: system('copy xyz.txt \\pserver\printer1'); ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs