You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PrinterCommands.java 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package com.mirfalahtech.xprinter;
  2. public class PrinterCommands {
  3. public static final byte HT = 0x9;
  4. public static final byte LF = 0x0A;
  5. public static final byte CR = 0x0D;
  6. public static final byte ESC = 0x1B;
  7. public static final byte DLE = 0x10;
  8. public static final byte GS = 0x1D;
  9. public static final byte FS = 0x1C;
  10. public static final byte STX = 0x02;
  11. public static final byte US = 0x1F;
  12. public static final byte CAN = 0x18;
  13. public static final byte CLR = 0x0C;
  14. public static final byte EOT = 0x04;
  15. public static final byte[] INIT = {27, 64};
  16. public static byte[] FEED_LINE = {10};
  17. public static byte[] SELECT_FONT_A = {20, 33, 0};
  18. public static byte[] SET_BAR_CODE_HEIGHT = {29, 104, 100};
  19. public static byte[] PRINT_BAR_CODE_1 = {29, 107, 2};
  20. public static byte[] SEND_NULL_BYTE = {0x00};
  21. public static byte[] SELECT_PRINT_SHEET = {0x1B, 0x63, 0x30, 0x02};
  22. public static byte[] FEED_PAPER_AND_CUT = {0x1D, 0x56, 66, 0x00};
  23. public static byte[] SELECT_CYRILLIC_CHARACTER_CODE_TABLE = {0x1B, 0x74, 0x11};
  24. public static byte[] SELECT_BIT_IMAGE_MODE = {0x1B, 0x2A, 33, -128, 0};
  25. public static byte[] SET_LINE_SPACING_24 = {0x1B, 0x33, 24};
  26. public static byte[] SET_LINE_SPACING_30 = {0x1B, 0x33, 30};
  27. public static byte[] TRANSMIT_DLE_PRINTER_STATUS = {0x10, 0x04, 0x01};
  28. public static byte[] TRANSMIT_DLE_OFFLINE_PRINTER_STATUS = {0x10, 0x04, 0x02};
  29. public static byte[] TRANSMIT_DLE_ERROR_STATUS = {0x10, 0x04, 0x03};
  30. public static byte[] TRANSMIT_DLE_ROLL_PAPER_SENSOR_STATUS = {0x10, 0x04, 0x04};
  31. public static final byte[] ESC_FONT_COLOR_DEFAULT = new byte[] { 0x1B, 'r',0x00 };
  32. public static final byte[] FS_FONT_ALIGN = new byte[] { 0x1C, 0x21, 1, 0x1B,
  33. 0x21, 1 };
  34. public static final byte[] ESC_ALIGN_LEFT = new byte[] { 0x1b, 'a', 0x00 };
  35. public static final byte[] ESC_ALIGN_RIGHT = new byte[] { 0x1b, 'a', 0x02 };
  36. public static final byte[] ESC_ALIGN_CENTER = new byte[] { 0x1b, 'a', 0x01 };
  37. public static final byte[] ESC_CANCEL_BOLD = new byte[] { 0x1B, 0x45, 0 };
  38. /*********************************************/
  39. public static final byte[] ESC_HORIZONTAL_CENTERS = new byte[] { 0x1B, 0x44, 20, 28, 00};
  40. public static final byte[] ESC_CANCLE_HORIZONTAL_CENTERS = new byte[] { 0x1B, 0x44, 00 };
  41. /*********************************************/
  42. public static final byte[] ESC_ENTER = new byte[] { 0x1B, 0x4A, 0x40 };
  43. public static final byte[] PRINTE_TEST = new byte[] { 0x1D, 0x28, 0x41 };
  44. }