Printing on a WIN32 system 
Author Message
 Printing on a WIN32 system

I'm sure someone has asked this question in the past, but here it is
again.

I would like to know how to print to a printer on a WIN32 system.  I
know in *INX, I can pipe the output to lpr using several different
methods,but not having much luck in WIN32.

For example, I can assign a file handle to "|lpr" in *INX and print
the output, but this only causes an error under WIN32 (obviously).  I
have also "nosed around" in the c:\windows\command directory where the
old DOS commands are - PRINT isn't there on the system I'm working
with.

Do I need to send output dirrectly to a port (ex. LPT1)?

If someone has done this already, please share your solution with me.

Thanks,

Jim



Sun, 22 Dec 2002 03:00:00 GMT  
 Printing on a WIN32 system

Quote:
> I'm sure someone has asked this question in the past, but here it is
> again.

That's right. I did it ;-)

Quote:
> I would like to know how to print to a printer on a WIN32 system.  I
> know in *INX, I can pipe the output to lpr using several different
> methods,but not having much luck in WIN32.

> For example, I can assign a file handle to "|lpr" in *INX and print
> the output, but this only causes an error under WIN32 (obviously).  I
> have also "nosed around" in the c:\windows\command directory where the
> old DOS commands are - PRINT isn't there on the system I'm working
> with.

If you want to print to a local printer, just open the device like in Unix

open LPR, "|LPR1";
print LPR ....
close LPR;

And if you want to use a remote printer, then map (or however they call it in
Windowish) the remote printer to a local one (it's a DOS-command):

net use LPT2 \\boss\lp

This assigns the printer 'lp' on computer 'boss' as your local printer LPT2
Then you can access it with

open LPR, "|LPR2";
print LPR ....
close LPR;

I did it a while ago, I hope that I remembered well ;-)

Ciao for now, Dirk
--
Dirk Ruediger, Rostock, Germany



Tue, 07 Jan 2003 03:00:00 GMT  
 Printing on a WIN32 system

Quote:
> If you want to print to a local printer, just open the device like in Unix

> open LPR, "|LPR1";
              ^^^^
> print LPR ....
> close LPR;

> And if you want to use a remote printer, then map (or however they call it in
> Windowish) the remote printer to a local one (it's a DOS-command):

> net use LPT2 \\boss\lp

> This assigns the printer 'lp' on computer 'boss' as your local printer LPT2
> Then you can access it with

> open LPR, "|LPR2";
             ^^^^^
> print LPR ....
> close LPR;

> I did it a while ago, I hope that I remembered well ;-)

As you can see, it's a while ago, that I did it ... the device names should be
LPTx and it's not an output pipe to another command, so you have to write
">LPTx".
Sorry!

Ciao for now, Dirk
--
Dirk Ruediger, Rostock, Germany

Hate the sin and love the sinner.
                -- Mahatma Gandhi



Tue, 14 Jan 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Weird behavior from system and Win32::CreateProcess on Win32 perl

2. How to print output of system() function to HTML

3. HELP! File system full, print NOT failing

4. Intermixing system() and print() output.

5. System, Exac and Print statement not syncronized

6. system() calls dont print to STDOUT or STDERR?

7. print command and system command

8. Can't print system file to browser.

9. Finding/Printing system uptime in perl

10. system()/print question

11. Printing to System Que

12. Unix system call to parse print queue info

 

 
Powered by phpBB® Forum Software