Send ESC commands to a printer in C#

Posted by Ewerton on Stack Overflow See other posts from Stack Overflow or by Ewerton
Published on 2010-05-14T21:36:29Z Indexed on 2010/05/14 21:44 UTC
Read the original article Hit count: 541

Filed under:
|
|
|
|

My application needs to print invoices, then a get the invoice from database, insert informations os the invoice in a big string (tellling the line, column, etc). after this a have the string ready to be sent to a printer.

My problem is: I need to put some ESC/P commands/characters in my big string

i try to do something like this:

        char formFeed = (char)12;
        Convert.ToChar(12);

        MyBigString.Insert(10, formFeed);

whit this, the line 10 will do a FormFeed, but this not work

NOTE: i send the MybigString all at once to printer.

to make my code works i need to send the data line by line to a printer ?

Thanks for the helps.

PS: Sorry my English, i'am a Brazilian developer which dont speak English (yet).

© Stack Overflow or respective owner

Related posts about c#

Related posts about printing