Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 9, 2023 01:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/5fc54c7247bd6848eb614d6086ebc185 to your computer and use it in GitHub Desktop.
Save parzibyte/5fc54c7247bd6848eb614d6086ebc185 to your computer and use it in GitHub Desktop.
var impresoraComoArchivo = new FileStream(fh, FileAccess.ReadWrite);
impresoraComoArchivo.WriteByte(0x1b); // ESC
impresoraComoArchivo.WriteByte(0x40); // @
impresoraComoArchivo.Write(Encoding.ASCII.GetBytes(textoParaImprimir), 0, textoParaImprimir.Length);
impresoraComoArchivo.WriteByte(0x1b); // Feed
impresoraComoArchivo.WriteByte(Convert.ToByte('d'));
impresoraComoArchivo.WriteByte(Convert.ToByte(1)); // 1 línea
impresoraComoArchivo.Dispose();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment