If the Printer has Windows Drivers, you can use the Classes in the
namespace: System.Drawing. Printing
--
Bela Istok
MVP C#
"Claudio" <claudio@digi.c om.br> wrote in message
news:eV84lWtmGH A.2372@TK2MSFTN GP04.phx.gbl...[color=blue]
>I asked if there was a way to print directly to a dotmatrix printer. The
>answer was yes, but I need to know how to do it.
>[/color]
I want to print in text mode, and direct to a dotmatrix printer (lpt1 port).
"Bela Istok" <bela_i@hotmail .com> escreveu na mensagem
news:9145FC16-ABF5-4F09-801D-1312A7930F06@mi crosoft.com...[color=blue]
> If the Printer has Windows Drivers, you can use the Classes in the
> namespace: System.Drawing. Printing
>
> --
> Bela Istok
> MVP C#
> "Claudio" <claudio@digi.c om.br> wrote in message
> news:eV84lWtmGH A.2372@TK2MSFTN GP04.phx.gbl...[color=green]
>>I asked if there was a way to print directly to a dotmatrix printer. The
>>answer was yes, but I need to know how to do it.
>>[/color]
>[/color]
I told you yes, it's possible just open the port and send the data to it.
Depending of the printer you may need the contorl characters or not.
I have done this using a serial Epson printer.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Claudio" <claudio@digi.c om.br> wrote in message
news:eV84lWtmGH A.2372@TK2MSFTN GP04.phx.gbl...[color=blue]
>I asked if there was a way to print directly to a dotmatrix printer. The
>answer was yes, but I need to know how to do it.
>[/color]
Ok, I don't see a problem here, you can use the printing clases to print
text to any printer that have a windows driver.
I don't know if I get you rigth, but you like to connect and send low level
printer comands for the port lpt1?
Regards,
--
Bela Istok
MVP C#
"Claudio" <claudio@digi.c om.br> wrote in message
news:OZ6pEgtmGH A.856@TK2MSFTNG P03.phx.gbl...[color=blue]
>I want to print in text mode, and direct to a dotmatrix printer (lpt1
>port).
>
> "Bela Istok" <bela_i@hotmail .com> escreveu na mensagem
> news:9145FC16-ABF5-4F09-801D-1312A7930F06@mi crosoft.com...[color=green]
>> If the Printer has Windows Drivers, you can use the Classes in the
>> namespace: System.Drawing. Printing
>>
>> --
>> Bela Istok
>> MVP C#
>> "Claudio" <claudio@digi.c om.br> wrote in message
>> news:eV84lWtmGH A.2372@TK2MSFTN GP04.phx.gbl...[color=darkred]
>>>I asked if there was a way to print directly to a dotmatrix printer. The
>>>answer was yes, but I need to know how to do it.
>>>[/color]
>>[/color]
>
>[/color]
Yes, I want to send low level (like: expand and compact charater comands)
and text, for the port lpt1 or a remote printer (\\servername\p rintername).
"Bela Istok" <bela_i@hotmail .com> escreveu na mensagem
news:F3511E27-C539-4439-8260-BCDEEFBA2CD0@mi crosoft.com...[color=blue]
> Ok, I don't see a problem here, you can use the printing clases to print
> text to any printer that have a windows driver.
>
> I don't know if I get you rigth, but you like to connect and send low
> level printer comands for the port lpt1?
>
> Regards,
>
> --
> Bela Istok
> MVP C#
> "Claudio" <claudio@digi.c om.br> wrote in message
> news:OZ6pEgtmGH A.856@TK2MSFTNG P03.phx.gbl...[color=green]
>>I want to print in text mode, and direct to a dotmatrix printer (lpt1
>>port).
>>
>> "Bela Istok" <bela_i@hotmail .com> escreveu na mensagem
>> news:9145FC16-ABF5-4F09-801D-1312A7930F06@mi crosoft.com...[color=darkred]
>>> If the Printer has Windows Drivers, you can use the Classes in the
>>> namespace: System.Drawing. Printing
>>>
>>> --
>>> Bela Istok
>>> MVP C#
>>> "Claudio" <claudio@digi.c om.br> wrote in message
>>> news:eV84lWtmGH A.2372@TK2MSFTN GP04.phx.gbl...
>>>>I asked if there was a way to print directly to a dotmatrix printer. The
>>>>answer was yes, but I need to know how to do it.
>>>>
>>>[/color]
>>
>>[/color]
>[/color]
If you like to Open the port ltp1 from C# you need to call the windows API
CreateFile
--
Bela Istok
MVP C#
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us > wrote
in message news:eBnL0ktmGH A.1800@TK2MSFTN GP05.phx.gbl...[color=blue]
> Hi Claudio, again ;)
>
>
> I told you yes, it's possible just open the port and send the data to it.
> Depending of the printer you may need the contorl characters or not.
>
> I have done this using a serial Epson printer.
>
>
> --
> --
> Ignacio Machin,
> ignacio.machin AT dot.state.fl.us
> Florida Department Of Transportation
>
>
>
> "Claudio" <claudio@digi.c om.br> wrote in message
> news:eV84lWtmGH A.2372@TK2MSFTN GP04.phx.gbl...[color=green]
>>I asked if there was a way to print directly to a dotmatrix printer. The
>>answer was yes, but I need to know how to do it.
>>[/color]
>
>[/color]
How did you do it? What functions you open the COM port? It is possible to
do the same for a LPT port?
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us >
escreveu na mensagem news:eBnL0ktmGH A.1800@TK2MSFTN GP05.phx.gbl...[color=blue]
> Hi Claudio, again ;)
>
>
> I told you yes, it's possible just open the port and send the data to it.
> Depending of the printer you may need the contorl characters or not.
>
> I have done this using a serial Epson printer.
>
>
> --
> --
> Ignacio Machin,
> ignacio.machin AT dot.state.fl.us
> Florida Department Of Transportation
>
>
>
> "Claudio" <claudio@digi.c om.br> wrote in message
> news:eV84lWtmGH A.2372@TK2MSFTN GP04.phx.gbl...[color=green]
>>I asked if there was a way to print directly to a dotmatrix printer. The
>>answer was yes, but I need to know how to do it.
>>[/color]
>
>[/color]
See my other post below the Ignacio Machin post ;)
--
Bela Istok
MVP C#
"Claudio" <claudio@digi.c om.br> wrote in message
news:ezThMFumGH A.3980@TK2MSFTN GP02.phx.gbl...[color=blue]
> Yes, I want to send low level (like: expand and compact charater comands)
> and text, for the port lpt1 or a remote printer
> (\\servername\p rintername).
>
> "Bela Istok" <bela_i@hotmail .com> escreveu na mensagem
> news:F3511E27-C539-4439-8260-BCDEEFBA2CD0@mi crosoft.com...[color=green]
>> Ok, I don't see a problem here, you can use the printing clases to print
>> text to any printer that have a windows driver.
>>
>> I don't know if I get you rigth, but you like to connect and send low
>> level printer comands for the port lpt1?
>>
>> Regards,
>>
>> --
>> Bela Istok
>> MVP C#
>> "Claudio" <claudio@digi.c om.br> wrote in message
>> news:OZ6pEgtmGH A.856@TK2MSFTNG P03.phx.gbl...[color=darkred]
>>>I want to print in text mode, and direct to a dotmatrix printer (lpt1
>>>port).
>>>
>>> "Bela Istok" <bela_i@hotmail .com> escreveu na mensagem
>>> news:9145FC16-ABF5-4F09-801D-1312A7930F06@mi crosoft.com...
>>>> If the Printer has Windows Drivers, you can use the Classes in the
>>>> namespace: System.Drawing. Printing
>>>>
>>>> --
>>>> Bela Istok
>>>> MVP C#
>>>> "Claudio" <claudio@digi.c om.br> wrote in message
>>>> news:eV84lWtmGH A.2372@TK2MSFTN GP04.phx.gbl...
>>>>>I asked if there was a way to print directly to a dotmatrix printer.
>>>>>The answer was yes, but I need to know how to do it.
>>>>>
>>>>
>>>
>>>[/color]
>>[/color]
>
>[/color]
--
Bela Istok
MVP C#
"Claudio" <claudio@digi.c om.br> wrote in message
news:%23Nr0hGum GHA.4728@TK2MSF TNGP05.phx.gbl. ..[color=blue]
> How did you do it? What functions you open the COM port? It is possible to
> do the same for a LPT port?
>
> "Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us >
> escreveu na mensagem news:eBnL0ktmGH A.1800@TK2MSFTN GP05.phx.gbl...[color=green]
>> Hi Claudio, again ;)
>>
>>
>> I told you yes, it's possible just open the port and send the data to it.
>> Depending of the printer you may need the contorl characters or not.
>>
>> I have done this using a serial Epson printer.
>>
>>
>> --
>> --
>> Ignacio Machin,
>> ignacio.machin AT dot.state.fl.us
>> Florida Department Of Transportation
>>
>>
>>
>> "Claudio" <claudio@digi.c om.br> wrote in message
>> news:eV84lWtmGH A.2372@TK2MSFTN GP04.phx.gbl...[color=darkred]
>>>I asked if there was a way to print directly to a dotmatrix printer. The
>>>answer was yes, but I need to know how to do it.
>>>[/color]
>>
>>[/color]
>
>[/color]
"Bela Istok" <bela_i@hotmail .com> wrote in message
news:51FD87F6-E514-4A9A-BAE6-E0CF274184B0@mi crosoft.com...[color=blue]
> If you like to Open the port ltp1 from C# you need to call the windows API
> CreateFile[/color]
That's correct.
IIRC there is an article in either MSDN mag or gotdotnet about how to do
this. I used it last year when I had the same issue.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Claudio" <claudio@digi.c om.br> wrote in message
news:ezThMFumGH A.3980@TK2MSFTN GP02.phx.gbl...[color=blue]
> Yes, I want to send low level (like: expand and compact charater comands)
> and text, for the port lpt1 or a remote printer
> (\\servername\p rintername).[/color]
That may be another completely different history, you never mentioned
nothing about it being remote. If so you cannot use the port directly. You
will depend of the windows driver you have installed in your local computer
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
That is true because you need a driver to do the mapping from local to
remote.
--
Bela Istok
MVP C#
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us > wrote
in message news:ujpOQMumGH A.4052@TK2MSFTN GP05.phx.gbl...[color=blue]
> Hi,
>
>
> "Claudio" <claudio@digi.c om.br> wrote in message
> news:ezThMFumGH A.3980@TK2MSFTN GP02.phx.gbl...[color=green]
>> Yes, I want to send low level (like: expand and compact charater comands)
>> and text, for the port lpt1 or a remote printer
>> (\\servername\p rintername).[/color]
>
>
> That may be another completely different history, you never mentioned
> nothing about it being remote. If so you cannot use the port directly. You
> will depend of the windows driver you have installed in your local
> computer
>
>
>
> --
> --
> Ignacio Machin,
> ignacio.machin AT dot.state.fl.us
> Florida Department Of Transportation
>[/color]
Microsoft Support is here to help you with Microsoft products. Find how-to articles, videos, and training for Microsoft Copilot, Microsoft 365, Windows 11, Surface, and more.
"Claudio" <claudio@digi.c om.br> wrote in message
news:eV84lWtmGH A.2372@TK2MSFTN GP04.phx.gbl...[color=blue]
>I asked if there was a way to print directly to a dotmatrix printer. The
>answer was yes, but I need to know how to do it.
>[/color]
I know I need the driver. What I want is to send text and control characters
directly to a printer. I do not want use windows spool to manage the
printing job. I have already done it, using the API CreateFile function. It
is working well. Thanks for the help.
"Bela Istok" <bela_i@hotmail .com> escreveu na mensagem
news:eG7PHSumGH A.1404@TK2MSFTN GP05.phx.gbl...[color=blue]
> That is true because you need a driver to do the mapping from local to
> remote.
>
> --
> Bela Istok
> MVP C#
> "Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us >
> wrote in message news:ujpOQMumGH A.4052@TK2MSFTN GP05.phx.gbl...[color=green]
>> Hi,
>>
>>
>> "Claudio" <claudio@digi.c om.br> wrote in message
>> news:ezThMFumGH A.3980@TK2MSFTN GP02.phx.gbl...[color=darkred]
>>> Yes, I want to send low level (like: expand and compact charater
>>> comands) and text, for the port lpt1 or a remote printer
>>> (\\servername\p rintername).[/color]
>>
>>
>> That may be another completely different history, you never mentioned
>> nothing about it being remote. If so you cannot use the port directly.
>> You will depend of the windows driver you have installed in your local
>> computer
>>
>>
>>
>> --
>> --
>> Ignacio Machin,
>> ignacio.machin AT dot.state.fl.us
>> Florida Department Of Transportation
>>[/color]
>[/color]
Comment