Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-04

Printing in Text mode on Windows?

9 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Lee Jenkins

On Linux, I would think printing to CUPS in text mode to be easy, but Windows I'm not sure. I have a unit that I use in Delphi to do this, but tried to port it over to Laz/FPC without success so far.

I did happen upon the rawmodetest example in /components/printing, but it doesn't seem to work. I tried it on Windows using an Epson 220 dot matrix receipt printer installed with the Generic Text Drive without success.

Any pointers?

Thanks,

Warm Regards, Lee

Reply by email

Jesus Reyes
to Lee Jenkins

--- Lee Jenkins escribi?:

Show quoted text 23 lines
On Linux, I would think printing to CUPS in text mode to be easy, but Windows I'm not sure. I have a unit that I use in Delphi to do this, but tried to port it over to Laz/FPC without success so far. I did happen upon the rawmodetest example in /components/printing, but it doesn't seem to work. I tried it on Windows using an Epson 220 dot matrix receipt printer installed with the Generic Text Drive without success. Any pointers? Thanks, -- Warm Regards, Lee

The Rawmode printing in windows, quote from ms docs "tells the spooler not to alter the print job at all prior to printing" as it seems your printer uses a propietary command set maybe you need to send some initialization or so to printer.

According my google result, TM-U220 (if that is the model of your printer) "Supports ESC/POS operating system; the standard code for POSprinters". You will probably need to have command reference for esc/pos. Then send to printer something it makes sense to it.

I don't know what do the Delphi unit does, what I know is that printer in Delphi don't have raw mode support by default.

Jesus Reyes A.

____________________________________________________________________________________ Yahoo! Deportes Beta
?No te pierdas lo ?ltimo sobre el torneo clausura 2008! Ent?rate aqu? http://deportes.yahoo.com

Reply by email

Lee Jenkins
to Jesus Reyes
Jesus Reyes wrote 41 lines
--- Lee Jenkins escribi?: > On Linux, I would think printing to CUPS in text mode to be easy, > but Windows > I'm not sure. I have a unit that I use in Delphi to do this, but > tried to port > it over to Laz/FPC without success so far. > > I did happen upon the rawmodetest example in /components/printing, > but it > doesn't seem to work. I tried it on Windows using an Epson 220 dot > matrix > receipt printer installed with the Generic Text Drive without > success. > > Any pointers? > > Thanks, > > -- > > Warm Regards, > > Lee > The Rawmode printing in windows, quote from ms docs "tells the spooler not to alter the print job at all prior to printing" as it seems your printer uses a propietary command set maybe you need to send some initialization or so to printer. According my google result, TM-U220 (if that is the model of your printer) "Supports ESC/POS operating system; the standard code for POSprinters". You will probably need to have command reference for esc/pos. Then send to printer something it makes sense to it. I don't know what do the Delphi unit does, what I know is that printer in Delphi don't have raw mode support by default. Jesus Reyes A.

Thanks for replying, Jesus.

Odd, I didn't have to do anything with the plain text using the unit I was using in Delphi, but then again I don't possess a lot of knowledge about internal printing. I have attached the unit that I was using in Delphi with great success.

Warm Regards, Lee "When my company started out, we were really, really, really, really small. Now...we're just really small." -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: PRTRAW.PAS Url: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080501/935e6caf/attachment.pl -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: RAWPRINT.PAS Url: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080501/935e6caf/attachment-0001.pl

Reply by email

Stephano
to Lee Jenkins: On Linux, I would think printing to CUPS in text mode to be easy, but Windows I'm not…
Lee Jenkins wrote 5 lines
I did happen upon the rawmodetest example in /components/printing, but it doesn't seem to work. I tried it on Windows using an Epson 220 dot matrix receipt printer installed with the Generic Text Drive without success. Any pointers?

It should work. In its normal mode, the Epson TM-U220 will print any printable ASCII character it receives. If your printer is a serial one, you should take care of the serial parameters such as the baud rate and flow control. Using a parallel printer would be much easier.

In any case, you can test the raw mode printing without using any set the port of the Generic Text Printer to File,
print using your routine, and inspect the file. That would show you whether it is your routine's fault or the printer's (which could be set to page mode).

HTH

Reply by email

Lee Jenkins
to Stephano
Stephano wrote 10 lines
Lee Jenkins wrote: > I did happen upon the rawmodetest example in /components/printing, but it > doesn't seem to work. I tried it on Windows using an Epson 220 dot matrix > receipt printer installed with the Generic Text Drive without success. > > Any pointers? It should work. In its normal mode, the Epson TM-U220 will print any printable ASCII character it receives. If your printer is a serial one, you should take care of the serial parameters such as the baud rate and flow control. Using a parallel printer would be much easier.

Thanks Stephano. I've been using the epson pos printers for quite a few years now so I thought that was the case.

One note: This particular printer is networked. Meaning that is it setup on a Windows computer on the network with Generic Text Driver, shared and mapped to the local computer when it is being printed.

I'll try it with direct connect, but it should work on a networked printer as well, and I need it to ;)

Show quoted text 6 lines
In any case, you can test the raw mode printing without using any set the port of the Generic Text Printer to File, print using your routine, and inspect the file. That would show you whether it is your routine's fault or the printer's (which could be set to page mode).

I'll try this. Thank you. I've just been using the rawprinttest sample in the /components/printers/sample directory.

Warm Regards, Lee "When my company started out, we were really, really, really, really small. Now...we're just really small."

Reply by email

Lee Jenkins
to Stephano: It should work. In its normal mode, the Epson TM-U220 will print any printable ASCII…
Stephano wrote 5 lines
In any case, you can test the raw mode printing without using any set the port of the Generic Text Printer to File, print using your routine, and inspect the file. That would show you whether it is your routine's fault or the printer's (which could be set to page mode).

I tried this and after setting up the printer to print to file, I was able to print a test page and it came out ok in the file.

However, once that was done, I tried printing using the rawmodetest.lpi project and I don't get the dialing asking for the file location and windows reports a printer error.

Is there somewhere in code that I should indicate the file location?

Never did this before, sorry.

Warm Regards, Lee "When my company started out, we were really, really, really, really small. Now...we're just really small."

Reply by email

Lee Jenkins
to Lee Jenkins
Lee Jenkins wrote 18 lines
Stephano wrote: > In any case, you can test the raw mode printing without using any > set the port of the Generic Text Printer to File, > print using your routine, and inspect the file. That would show you > whether it is your routine's fault or the printer's (which could be set > to page mode). I tried this and after setting up the printer to print to file, I was able to print a test page and it came out ok in the file. However, once that was done, I tried printing using the rawmodetest.lpi project and I don't get the dialing asking for the file location and windows reports a printer error. Is there somewhere in code that I should indicate the file location? Never did this before, sorry.

The problem was setting up the port as a file path (when setting up the printer) and that worked well to print to the file, but it doesn't print to the actual printer from what I can tell and I'm wondering if there is extra steps necessary to print to a networked printer, but that seems doubtful to me.

Warm Regards, Lee "When my company started out, we were really, really, really, really small. Now...we're just really small."

Reply by email

Stephano
to Lee Jenkins
Lee Jenkins wrote 24 lines
Lee Jenkins wrote: > Stephano wrote: >> In any case, you can test the raw mode printing without using any >> set the port of the Generic Text Printer to File, >> print using your routine, and inspect the file. That would show you >> whether it is your routine's fault or the printer's (which could be set >> to page mode). > I tried this and after setting up the printer to print to file, I was able to > print a test page and it came out ok in the file. > > However, once that was done, I tried printing using the rawmodetest.lpi project > and I don't get the dialing asking for the file location and windows reports a > printer error. > > Is there somewhere in code that I should indicate the file location? > > Never did this before, sorry. > The problem was setting up the port as a file path (when setting up the printer) and that worked well to print to the file, but it doesn't print to the actual printer from what I can tell and I'm wondering if there is extra steps necessary to print to a networked printer, but that seems doubtful to me.

I now understand that you have a remote printer on a networked PC, and you want to control it from your local PC.

I have not understood what you have done and the results you got. So with the printer connected to the remote PC, try each of the following tests and report back the results. Note that each test is based on the initial setup, ie changes done for each test should be undone for the next test.

1. Print a test page from your remote PC.
2. Print a test page from your local PC.
3. Set the Generic Printer Driver on your local PC to print to file and use your routine to print.
4. Set the Generic Printer Driver on your remote PC to print to file and use your routine to print.

If all the above tests succeed, I see no reason that would prevent you from printing the way you want, though I have never tried this setup.

Stephano

Reply by email

Lee Jenkins
to Stephano
Stephano wrote 40 lines
Lee Jenkins wrote: > Lee Jenkins wrote: >> Stephano wrote: >>> In any case, you can test the raw mode printing without using any >>> set the port of the Generic Text Printer to File, >>> print using your routine, and inspect the file. That would show you >>> whether it is your routine's fault or the printer's (which could be set >>> to page mode). >> I tried this and after setting up the printer to print to file, I was able to >> print a test page and it came out ok in the file. >> >> However, once that was done, I tried printing using the rawmodetest.lpi project >> and I don't get the dialing asking for the file location and windows reports a >> printer error. >> >> Is there somewhere in code that I should indicate the file location? >> >> Never did this before, sorry. >> > The problem was setting up the port as a file path (when setting up the printer) > and that worked well to print to the file, but it doesn't print to the actual > printer from what I can tell and I'm wondering if there is extra steps necessary > to print to a networked printer, but that seems doubtful to me. > I now understand that you have a remote printer on a networked PC, and you want to control it from your local PC. I have not understood what you have done and the results you got. So with the printer connected to the remote PC, try each of the following tests and report back the results. Note that each test is based on the initial setup, ie changes done for each test should be undone for the next test. 1. Print a test page from your remote PC. 2. Print a test page from your local PC. 3. Set the Generic Printer Driver on your local PC to print to file and use your routine to print. 4. Set the Generic Printer Driver on your remote PC to print to file and use your routine to print.

Just to be sure, I hooked up an Epson TM88III to the LPT1 on my computer to negate the possibility that it is a network printing problem and it doesn't work either. I can see the print job going into the queue for the printer and then disappearing quickly, but no output to the printer.

Printing like this is integral to my app (which I'm re-writing from Delphi) but I will have to go with Delphi if I can't get this to work :(

I have one other thing to try and see if I can get the rawprt unit to work with Lazarus.

Warm Regards, Lee "When my company started out, we were really, really, really, really small. Now...we're just really small."

Reply by email