原討論文
底下為個人整理:
採用LPT/RS232均可:
這是控制指令,翻成 chr (&h??) 即可
byte[] ESC_FF = new byte[] { 0x1B, 0x56, 0x42 };
byte[] ESC_G = new byte[] { 0x1B, 0x47 };
byte[] ESC_R = new byte[] { 0x1B, 0x52 };
byte[] ESC_P = new byte[] { 0x1B, 0x50, 0x42, 0x01 };
byte[] ESC_C = new byte[] { 0x1B, 0x43 };
byte[] ESC_V = new byte[] { 0x1B, 0x56,0x42 };
列印:
Dim str as string
str = Chr(&H1B) & "P" & "B" & "1" & "aaa" & Chr(&HD)
str & = Chr(&H1B) & "P" & "B" & "1" & "bbb" & Chr(&HD)
str & = Chr(&H1B) & "P" & "B" & "1" & "ccc" & Chr(&HD)
Dim strByte() as Byte = System.Text.Encoding.Default.GetBytes(str)
invoicePrinter.Open()
invoicePrinter.Write(strByte, 0,strByte.Length)
invoicePrinter.Close()
沒有留言:
張貼留言