0

I'm sending request to a printer using Epson Emulation. I'm using C# RawPrintHelper defined as here.

I want to make absolutely sure I am on the very first position (first line, first character) before I start printing. So I send the following requests to the printer:

// initialize printer
RawPrinterHelper.SendStringToPrinter(this.PrinterName, (char)0x1B + "@");
// eject paper to force re-alignment...
RawPrinterHelper.SendStringToPrinter(this.PrinterName, "" + (char)0x1B + (char)25 + (char)85);
// form feed...
RawPrinterHelper.SendStringToPrinter(this.PrinterName, "" + (char)0x1B + (char)0x0C);
// make sure we're at start of page !
RawPrinterHelper.SendStringToPrinter(this.PrinterName, (char)0x1B + "$" + (char)0x00 + (char)0x00);

The paper actually does roll-back, but then return to the initial position (line on previous print). Even the form feed call didn't help.

The goal is to get back at the top of the page, ideally without waisting a full page...

neggenbe
  • 1,697
  • 2
  • 24
  • 62
  • As I said yesterday - the printer has a perfectly good driver - you would do better by using the built in capabilities of .Net rather than trying to reinvent the wheel - that is what will protect the clients _"costly hardwarde investment"_. Having said that - by my reading of the manual ejecting the form is done with ESC 0x19 0x52 (or (char)82 or 'R'). FormFeed does NOT need a preceding ESC character. – PaulF Jul 10 '18 at 09:10
  • Awesome, thanks. As for GUI - I've tested, but despite all my efforts, the first two lines I print overlap... Although, it depends on paper width, as I discovered, but nothing I do helps... Spent more time on this than it actually takes to directly talk to the printer... – neggenbe Jul 10 '18 at 10:11
  • If that solved (some of) the problems - I will put it as an answer so you mark it as correct in case other SO users have a similar issue. – PaulF Jul 10 '18 at 10:22
  • Reverse paper movement is going to result in terrible output quality. It's not really designed to work like that even if you can make it happen. You shouldn't need to "get back to the top of the page". Everything you want to print should be ready and ordered according to it's position on the page. As for "top of page", just issue a formfeed and start printing. There's never a reason to go back and find it again. – Terry Carmen Jul 10 '18 at 17:29
  • Agreed - I don't try to go back to top - I want to make sure I start at top - as a matter of fact, depending on the paper I put in the printer, the printer itself prevents from printing on the first few lines and performs the rollback. If I put normal A4 paper, this doesn't happen... I thought this was due to GUI call, but actually, not at all, it's also happening with direct call - I just contacted the manufacturer to get more insight into this ! – neggenbe Jul 12 '18 at 07:23

0 Answers0