2

I am using a dot matrix printer and have to do a continious printing job.

The paper I use is 213mm X 350mm and splitted at the middle of the page.

I've tried something and I am able to print the first side of the page but the prints are shifted when it comes to the second part of the page?

Is there any tutorial which explains how to do this from scracth, including what the printer's settings should be.

I am coding with c# but i guess .Net's library is not suitable for this.

Any suggestions?

4

3 に答える 3

3

Maybe looks a bit odd, but before a while we've done printing from Windows to the matrix printers using something like this

  1. write contents to a file (using printers escape sequences when needed; writing FF (form feed) where page should end; you need to have corrent page size set on printer)
  2. shell exec "copy file.txt lpt1:"
于 2010-03-12T06:47:09.337 に答える
2

Here's what I have done:

My printer was OKI 3320. I've found its manual and learned the printer's escape characters.

I've prepared a string template to match the formatting. Including tags for variables, "carriage return", "line feed" and "form feed" escape sequences.

I've measured my papers length and set my printers rear feed page length according to it. By doing that, when I send the printer FF command, it will adjust the printer to the next form's starting point.

In my application I've taken the string replaced the tokens with apropritate values and send them to printer using RawPrinterHelper. Since the RawPrinterHelper only supports English characters, I had to replace the Turkish characters also.

It works fine now.

Of course there may be more professional approaches. You can totally control your printer by using escape sequences. You can give coordinates of the print area or set the page length programmatically which eliminates the need for configuring printer. Since my application shall be uses once only, my solution is adequate for me.

于 2010-03-22T07:23:36.690 に答える
-1

Maybe looks a bit odd, but before a while we've done printing from Windows to the matrix printers using something like this

1.write contents to a file (using printers escape sequences when needed; writing FF (form feed) where page should end; you need to have corrent page size set on printer) 2.shell exec "copy file.txt lpt1:"

Can Nighttingale7 explain this further:

  • will printing like this preserve the font type and font size of the file? If so, how are we to set the font type and font size when writing data to the file?
于 2010-09-23T07:55:18.680 に答える