Dotmatrix printer - again

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Claudio

    Dotmatrix printer - again

    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.


  • Bela Istok

    #2
    Re: Dotmatrix printer - again

    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]

    Comment

    • Claudio

      #3
      Re: Dotmatrix printer - again

      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]


      Comment

      • Ignacio Machin \( .NET/ C# MVP \)

        #4
        Re: Dotmatrix printer - again

        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=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]


        Comment

        • Bela Istok

          #5
          Re: Dotmatrix printer - again

          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]

          Comment

          • Claudio

            #6
            Re: Dotmatrix printer - again

            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]


            Comment

            • Bela Istok

              #7
              Re: Dotmatrix printer - again

              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]

              Comment

              • Claudio

                #8
                Re: Dotmatrix printer - again

                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]


                Comment

                • Bela Istok

                  #9
                  Re: Dotmatrix printer - again

                  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]

                  Comment

                  • Bela Istok

                    #10
                    Re: Dotmatrix printer - again

                    This an example to open a ltp and com port from vb.net (I don't find any in
                    C#, but is the same)


                    --
                    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]

                    Comment

                    • Ignacio Machin \( .NET/ C# MVP \)

                      #11
                      Re: Dotmatrix printer - again

                      Hi,



                      "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


                      Comment

                      • Ignacio Machin \( .NET/ C# MVP \)

                        #12
                        Re: Dotmatrix printer - again

                        Hi,


                        "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


                        Comment

                        • Bela Istok

                          #13
                          Re: Dotmatrix printer - again

                          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]

                          Comment

                          • Greg Young

                            #14
                            Re: Dotmatrix printer - again

                            I believe this is exactly what you are looking for ... This would require
                            you to set it up as a generic printer in windows.

                            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.


                            Cheers,

                            Greg Young
                            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]


                            Comment

                            • Claudio

                              #15
                              Re: Dotmatrix printer - again

                              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

                              Working...