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.

1796 lines
45 KiB

3 years ago
/*!
* \~chinese
* @header PTCommandESC.h
* @abstract ESC
*
* \~english
* @header PTCommandESC.h
* @abstract ESC Command
*/
#import <Foundation/Foundation.h>
#import "PTBitmap.h"
typedef NS_ENUM(NSInteger, ESCText) {
ESCTextNormal = 0,
ESCTextMini = 1,
ESCTextBold = 8,
ESCTextDoubleHeight = 16,
ESCTextDoubleWidth = 32,
ESCTextUnderline = 128,
};
typedef NS_ENUM(NSInteger, ESCBarcode) {
ESCBarcodeB_UPCA = 65,
ESCBarcodeB_UPCE = 66,
ESCBarcodeB_EAN13 = 67,
ESCBarcodeB_EAN8 = 68,
ESCBarcodeB_CODE39 = 69,
ESCBarcodeB_ITF = 70,
ESCBarcodeB_CODEBAR = 71,
ESCBarcodeB_CODE93 = 72,
ESCBarcodeB_CODE128 = 73,
};
/**
* ESC-POS :200
* ESC-POS command set: about 200 functions which generated into command
*/
@interface PTCommandESC : NSObject
/**
* kCFStringEncodingGB_18030_2000
* Encoding format of character string, default is kCFStringEncodingGB_18030_2000
*/
@property (nonatomic, assign) NSStringEncoding encoding;
@property (nonatomic, strong) NSMutableArray *cmdQueue;
- (void)initCommandQueue;
- (void)appendCommandData:(NSData *)cmdData;
- (NSData *)getCommandData;
- (void)appendText:(NSString *)text;
/**
get printer status
210
561
*/
- (void)getPrinterStatus;
/** 打印自检页
* Print SelfTest
*/
- (void)printSelfTest;
/** 打印并走纸一行
* Print and feed one line
*/
- (void)printAndLineFeed;
/** 回车 Carriage return */
- (void)printAndCarriageReturn;
/**
automatic return
@param flag true: false
*/
- (void)turnOnPrintStatusCallBack:(BOOL)flag;
/**
* page 73.
* Print and feed paper
* @param offset (0~255)
*/
- (void)printAndFeed:(NSInteger)offset;
/**
* page 76.
* Print and retreat paper
* @param offset (0~48)
*/
- (void)printAndReverseFeed:(NSInteger)offset;
/**
* page 78. n
* Print and feed n lines forward
* @param lines (0~255)
*/
- (void)printAndFeedLines:(NSInteger)lines;
/**
* page 80. n
* Print and retreat n line
* @param lines (0~2)
*/
- (void)printAndReverseFeedLines:(NSInteger)lines;
/**
* page 83.
* Set line spacing default
*/
- (void)setLineSpacingDefault;
/**
* page 85.
* Set line spacing
* @param spacing (0~255)
*/
- (void)setLineSpacing:(NSInteger)spacing;
#pragma mark Character Commands
/**
* page 91.
* Set character spacing on the right
* @param spacing (0~255)
*/
- (void)setRightCharacterSpacing:(NSInteger)spacing;
/** page 93. 设置打印字体模式
* Set print font mode
*/
- (void)setTextMode:(ESCText)mode;
/**
* page 93. 线
Set text mode, the effect can be overlapped, like bold and underline
*/
- (void)setTextStyleMini:(BOOL)mini
bold:(BOOL)bold
doubleWidth:(BOOL)doubleWidth
doubleHeight:(BOOL)doubleHeight
underline:(BOOL)underline;
/**
* page 93
* Add text and set text form
*
* @param text text string
* @param mode ESCText
*/
- (void)appendText:(NSString *)text mode:(ESCText)mode;
/**
* page 98.
* Set or cancel character setting
* n = 0, character set cancel [default]
* n = 1, character set selected
* @param set (0~1)
*/
- (void)setUserDefinedCharacterSet:(NSInteger)set;
/**
* page 99.
* Define user-defined character
* @param codeStart (32~126)
* @param codeEnd (32~126)
* @param horizontal (data.length = 3*horizontal)
* @param data (0~255)
*/
- (void)defineCharactersWithCodeStart:(NSInteger)codeStart
codeEnd:(NSInteger)codeEnd
horizontal:(NSInteger)horizontal
data:(NSData *)data;
/**
* page 104. 线
* Underline mode ON/OFF
* 0,48 turns off underline mode
* 1,49 turns on underline mode (1-dot thick)
* 2,50 turns on underline mode (2-dots thick)
* @param underline (0~2,48~50)
*/
- (void)setUnderline:(NSInteger)underline;
/**
* page 106.
* Cancel user-defined character
* @param n (32~126)
*/
- (void)cancelUserDefinedCharacters:(NSInteger)n;
/**
* page 108.
* Character bold ON/OFF
* n = 0 [default]
* @param bold (0~255)
*/
- (void)setBold:(NSInteger)bold;
/**
* page 109.
* Character black ON/OFF
* n = 0 [default]
*
* @param doubleStrike (0~255)
*/
- (void)setDoubleStrike:(NSInteger)doubleStrike;
/**
* page 110.
* Set character font type
* @param font (0~1) 0:fontA 1:fontB
*/
- (void)setCharacterFont:(NSInteger)font;
/** ESC R
* page 115.
* Set International character set
* @param set (n<=15)
*/
- (void)setInternationalCharacterSet:(NSInteger)set;
/** ESC V
* page 117. 90
* 90° clockwise ON/OFF
* @param mode (0~2),(48~50)
*/
- (void)setVerticalMode:(NSInteger)mode;
/** ESC r
* page 119.
* Set print color
* n = 0 [default]
* 0,48 black
* 1,49 red
* @param color (0,1,48,49)
*/
- (void)setPrintColor:(NSInteger)color;
/** ESC t
* page 121. for Portable machine
* Set character encoding table
*
* @param table (0~5),(13-21),(26),(32-34)(36,37),(39,40),(45-52)
*/
- (void)setCharacterCodeTable:(NSInteger)table;
/// codepage,for POS Printer
/// @param codepage (0~5),(13~21),26,32-34,36,37,39-40,45-52
- (void)setPrinterCodepage:(NSInteger)codepage;
/**
Character Transform
@param mode 0close1 2 3
*/
- (void)setCharacterTransformMode:(NSInteger)mode;
/** 进入保存模式 */
- (void)enterPrinterSaveMode;
/** 退出保存模式 */
- (void)exitPrinterSaveMode;
/** 获取越南语变形模式 00 00为关 01 00ASCII输入02 00utf-8输入 */
- (void)getVietnamTransformMode;
/** 设置越南语变形模式,设置后重启打印机 48为关 49ASCII输入50utf-8输入 */
- (void)setVietnamTransformMode:(NSInteger)mode;
/**
@param status 48close 49:open
*/
- (void)setThaiTransformStatus:(NSInteger)status;
/**
language mode
//
@param mode 0:SimplifiedChinese 1:English 2:TraditionalChinese
*/
- (void)setPrinterLanguageMode:(NSInteger)mode;
/** ESC {
* page 124.
* Reverse print ON/OFF
* @param mode (0~255)
*/
- (void)setUpToDownMode:(NSInteger)mode;
#pragma mark GS ( N
/** GS ( N
* page 128.
* Set character color
* color = 49 [default]
*
* @param color (58~51)
*/
- (void)setCharacterColor:(NSInteger)color;
/** GS ( N
* page 130.
* Set background color
* m = 48 [default]
* 48 none; 49 clolor1; 50 color2; 51 color3
* @param color (48~51)
*/
- (void)setBackgroundColor:(NSInteger)color;
/** GS ( N
* page 132.
* Shadow mode ON/OFF
*
* @param mode (0,1,48,49)
* @param color (48~51) 48 none; 49 clolor1; 50 color2; 51 color3
*/
- (void)setShadowMode:(NSInteger)mode color:(NSInteger)color;
/** GS !
* page 134.
8 Set character size
* n = 0 [default]
*/
- (void)setCharacterSize:(NSInteger)size;
- (void)setCharacterWidth:(NSInteger)width height:(NSInteger)height;
/**
Set character size
@param size 0-13 2x2:fontB 3x3:fontA
0:2x2mm,1:3x3mm,2:4x4mm,3:6x6mm,4:8x8mm,5:9x9mm,6:10x10mm
7:12x12mm,8:14x14mm,9:15x15mm,10:16x16mm,11:18x18mm,12:21x21mm,13:24x24mm
*/
- (void)setCharacterMultipleSize:(NSInteger)size;
/// 设置中文的思源字体大小
/// @param size 字体大小:size = 33(42dot) ,34(36dot), 35(32dot)
- (void)setChineseSesBlackFontWithSize:(NSInteger)size;
/// 设置英文的思源字体大小
/// @param size 字体大小size = 33(42dot) ,34(36dot), 35(32dot)
- (void)setEnglishSesBlackFontWithSize:(NSInteger)size;
/** GS B
* page 136.
* Black and white reverse print mode
* n = 0 [default]
*
* @param reverse (0~255)
*/
- (void)setReverse:(NSInteger)reverse;
/** GS b
* page 138.
* Smooth mode ON/OFF
* mode = 0 [default]
*
* @param smooth (0~255)
*/
- (void)setSmooth:(NSInteger)smooth;
#pragma mark Panel Button Commands
/**
* page.140 /
* Enable / disable panel button
* n = 0 enable [default]
* n = 1 disable
*
* @param mode (0~255)
*/
- (void)setPanelButtonMode:(NSInteger)mode;
/**
* page 145. 使
* Whether to use paper out sensor
*/
- (void)enableOutPaperSensor:(BOOL)enable;
/**
* page 147.
* Set stop print sensor
*/
- (void)enableStopPrintSensor:(BOOL)enable;
#pragma mark Print Positioin Commands(Page Mode)
/** 打印并回到标准模式
* Print and return to standard mode
*/
- (void)printAndReturnStandardMode;
/** 在页模式下取消打印数据
* Cancel print data in page mode
*/
- (void)cancelPrint;
/** 在页模式下打印数据
* Print data in page mode
*/
- (void)printDataInPageMode;
/// 定位到下个缝标,行模式下使用
- (void)setPrinterAutomaticPosition;
/// 定位到下个缝标,页模式下使用
- (void)positionNextLabel;
/**
* page 151.
* Set horizontal tab
*/
- (void)setHorizontalTab;
/**
* page 152.
* Set absolute print position
*
* @param position 0-255
*/
- (void)setAbsolutePosition:(NSInteger)position;
/**
* page 154.
* Set horizontal tab position
*/
- (void)setHorizontalTabPositionsData:(NSData *)data;
/**
* page 156.
* Set print direction in page mode
* 0,48 left to right
* 1,49 bottom to top
* 2,50 right to left
* 3,51 top to bottom
* @param direction (0~3),(48~51)
*/
- (void)pageSetPrintDirection:(NSInteger)direction;
/**
* page 158.
* Set print area in page mode
*
* @param xPos (0~65535)
* @param yPos (0~65535)
* @param width (0~65535)
* @param height (0~65535)
*/
- (void)pageSetPrintAreaWithXPos:(NSInteger)xPos
yPos:(NSInteger)yPos
width:(NSInteger)width
height:(NSInteger)height;
/**
* page 163.
* Set relative print position
*
* @param position (-32768 ~ 32767)
*/
- (void)setRelativePosition:(NSInteger)position;
/**
* page 165.
* Set justification
* n = 0 [default]
* 0,48 left justification
* 1,49 centered
* 2,50 right justification
*
* @param justification (0~2),(48~50)
*/
- (void)setJustification:(NSInteger)justification;
/**
* page 167.
* Set absolute vertical print position in page mode
* @param yPos (0~65535)
*/
- (void)pageSetAbsoluteYPos:(NSInteger)yPos;
/**
* page 169.
* Set left margin width
* @param left (0~65535)
*/
- (void)setLeftMargin:(NSInteger)left;
/**
* page 171.
* Set start print position
* 0,48 cancel data in the current print buffer.
* 1,49 print data in the current print buffer.
*
* @param mode (0,1,48,49)
*/
- (void)setLinePrintPositionMode:(NSInteger)mode;
/**
* page 173.
* Set print area width
* @param width (0~65535)
*/
- (void)setPrintAreaWidth:(NSInteger)width;
/**
* page 177.
* Set relative vertical print position in page mode
* @param yPos (-32767 ~ 32768)
*/
- (void)pageSetRelativeYPos:(NSInteger)yPos;
#pragma mark Bit Image Commands
/**
* page 180.
* Set bitmap mode
* @param mode (0~1),(31~32)
* @param width (1~2047)
* @param data (0~255)
*/
- (void)setImageMode:(NSInteger)mode imageWidth:(NSInteger)width data:(NSData *)data;
/**
* page 194. NV
* Print NV bitmap
* @param imageID (1~255)
* @param mode (0,48:Normal),(1,49:Double-width),(2,50:Double-height),(3,51:Quadruple)
*/
- (void)setNVBitImage:(NSInteger)imageID Mode:(NSInteger)mode;
/**
* page 210. NV
* Transmit NV graphic memory size
* @param size 0,48
*/
- (void)setNVGraphicsMemorySize:(NSString *)size;
/**
* page 212.
* Set graphic dot density
* @param fn 1,49
* @param x 50,51
*/
- (void)setGraphicDotDensity:(NSInteger)fn x:(NSInteger)x;
/**
* page 214.
* Print graphic data in buffer
* @param fn 2,50
*/
- (void)printBufferGraphic:(NSInteger)fn;
/**
* page 215. NV
* Transmit graphic remaining memory
* @param fn 3,51
*/
- (void)transmitGraphicRemainingMemory:(NSInteger)fn;
/**
* page 216.
* Transmit downloaded graphic remaining memory
* @param fn 4,52
*/
- (void)transmitDownloadGraphicRemainingMemory:(NSInteger)fn;
/**
* page 218. NV
* Transmit defined NV graphic key code list
*/
- (void)transmitNVGrapihcKeyCodeList;
/**
* page 220. NV
* Delete all the NV graphic data
*/
- (void)deleteNVGraphicAll;
/**
* page 221. NV
* Delete the defined NV graphic data
* @param keycode1 (32~126)
* @param keycode2 (32~126)
*/
- (void)deleteNVGraphicWithKeycode1:(NSInteger)keycode1 keycode2:(NSInteger)keycode2;
/**
* page 222. NV
* Define raster NV graphic data
* @param keycode (32~126)
* @param keycode2 (32~126)
* @param imageWidth (1~8192)
* @param imageHeight (1~2304)
* @param data imageData
*/
- (void)defineRasterNVGraphicData:(NSData *)data
keycode:(NSInteger)keycode
keycode2:(NSInteger)keycode2
imageWidth:(NSInteger)imageWidth
imageHeight:(NSInteger)imageHeight;
/**
* page 227. NV
* Define column NV graphic data
* @param keycode (32~126)
* @param keycode2 (32~126)
* @param imageWidth (1~8192)
* @param imageHeight (1~2304)
* @param data imageData
*/
- (void)defineColumnNVGraphicData:(NSData *)data
keycode:(NSInteger)keycode
keycode2:(NSInteger)keycode2
imageWidth:(NSInteger)imageWidth
imageHeight:(NSInteger)imageHeight;
/**
* page 231. NV
* Print specified NV graphic data
* @param keycode (32~126)
* @param keycode2 (32~126)
* @param xScale 1,2
* @param yScale 1,2
*/
- (void)printNVGraphicWithKeycode:(NSInteger)keycode
keycode2:(NSInteger)keycode2
xScale:(NSInteger)xScale
yScale:(NSInteger)yScale;
/**
* page 238.
* Transmit defined downloaded graphic key code list
*/
- (void)transmitGraphicKeycodeList;
/**
* page 240. NV Delete all the NV graphic data
*/
- (void)deleteDownloadedNVGraphicAll;
/**
* page 241. NV Print defined NV graphic data
*
* @param keycode (32~126)
* @param keycode2 (32~126)
*/
- (void)deleteDownloadedNVGraphicKeycode:(NSInteger)keycode keycode2:(NSInteger)keycode2;
/**
* page 242.
* Defined downloaded raster NV graphic data
* @param keycode (32~126)
* @param keycode2 (32~126)
* @param imageWidth (1~8192)
* @param imageHeight (1~2304)
* @param data imageData
*/
- (void)defineDownloadedRasterNVGraphicData:(NSData *)data
keycode:(NSInteger)keycode
keycode2:(NSInteger)keycode2
imageWidth:(NSInteger)imageWidth
imageHeight:(NSInteger)imageHeight;
/**
* page 246.
* Define downloaded column NV graphic data
* @param keycode (32~126)
* @param keycode2 (32~126)
* @param imageWidth (1~8192)
* @param imageHeight (1~2304)
* @param data imageData
*/
- (void)defineDownloadedColumnNVGraphicData:(NSData *)data
keycode:(NSInteger)keycode
keycode2:(NSInteger)keycode2
imageWidth:(NSInteger)imageWidth
imageHeight:(NSInteger)imageHeight;
/**
* page 250. NV a
* Print specified downloaded NV graphic dat
*
* @param keycode (32~126)
* @param keycode2 (32~126)
*/
- (void)printDownloadedNVGraphicWithKeycode:(NSInteger)keycode
keycode2:(NSInteger)keycode2
xScale:(NSInteger)xScale
yScale:(NSInteger)yScale;
/**
* page 252. Store raster graphic data in print buffer
* Users have the option of specifying horizontal(times bx) * vertical(times by) size setting for the selected data.
* @param xScale (1~2)
* @param yScale (1~2)
* @param imageWidth (1~2047)
* @param imageHeight (1~1662,831,415)
* @param data imageData
*/
- (void)storeRasterGraphicData:(NSData *)data
xScale:(NSInteger)xScale
yScale:(NSInteger)yScale
imageWidth:(NSInteger)imageWidth
imageHeight:(NSInteger)imageHeight;
/**
* page 261. Store column graphic data in print buffer
* Users have the option of specifying horizontal bx * vertical by size setting for the selected data.
* @param xScale (1~2)
* @param yScale (1~2)
* @param imageWidth (1~2047)
* @param imageHeight (1~1662,831,415)
* @param data imageData
*/
- (void)storeColumnGraphicData:(NSData *)data
xScale:(NSInteger)xScale
yScale:(NSInteger)yScale
imageWidth:(NSInteger)imageWidth
imageHeight:(NSInteger)imageHeight;
/**
* page 264. NV Define NV bitmap
* Defines the NV bit image in the NV graphics area.
* @param number (1~255)
*/
- (void)defineNVGraphicData:(NSData *)data number:(NSInteger)number;
/**
* page 268.
* Print raster bitmap
* @param image source image
* @param mode binary/dithering
* @param compress TIFF/ZPL2/None
* @param package Whether the data is subcontracted
*/
- (void)appendRasterImage:(CGImageRef)image mode:(PTBitmapMode)mode compress:(PTBitmapCompressMode)compress package:(BOOL)package;
/**
* page 273. Defined downloaded bitmap
*
* @param widthBytes (1~255)
* @param heightBytes (1~255)
* @param imageData imageData
*/
- (void)defineDownloadedImage:(NSData *)imageData
widthBytes:(NSInteger)widthBytes
heightBytes:(NSInteger)heightBytes;
/**
* page 276.
* Print downloaded bitmap
* (0,48:Normal),(1,49:Double-width),(2,50:Double-height),(3,51:Quadruple)
*
* @param scale (0~3),(48~51)
*/
- (void)printDownloadedImageWithScale:(NSInteger)scale;
/**
* page 283.
* Print variable vertical bitmap
*/
- (void)appendColumnImage:(CGImageRef)image scale:(NSInteger)scale;
#pragma mark Status Commands
/**
* page 288.
* Transmit real-time status
* @param status (1~4),(7~8) 24
*/
- (void)transmitRealTimeStatus:(NSInteger)status;
/**
* page 305.
* Transmit peripheral device status
* @param status (0,48)
*/
- (void)transmitPeripheralDeviceStatus:(NSInteger)status;
/**
* page 306.
* Transmit paper sensor status
*/
- (void)transmitPaperSonsorStatus;
/**
* page 308. /
* Enable/disable automatic status back (ASB)
*/
- (void)setASBStatusWithDrawer:(BOOL)drawer
offline:(BOOL)offline
error:(BOOL)error
rollPaper:(BOOL)rollPaper
panelSwitch:(BOOL)panelSwitch;
/**
* page 322. /
* Enable/disable ink automatic status back (ASB)
*/
- (void)setInkASBWithOffline:(BOOL)offline detection:(BOOL)detection;
/**
* page 327.
* Transmit status
* 1,49: transmits paper sensor status
* 2,50: transmits drawer kick-out connector status
* 4,52: transmits ink status
*
* @param status (1,2,4,49,50,52)
*/
- (void)transmitStatus:(NSInteger)status;
#pragma mark Bar Code Commands
/**
* page 334.
* Set font of bar code number
* 0,48 font a
* 1,49 font b
* 2,50 font c
*
* @param font (0~2),(48~50)
*/
- (void)setHRIFont:(NSInteger)font;
/**
* @param justification page 165. justification Value0,1,2 : leftcenterright
* @param type page 339. Value(A:0~6),(B:65~73)
* @param width page 355. Value(2~6),(68~76)
* @param height page 337. Value(1~255)
* @param hri page 332. Value(0~3),(48~51):
* @param data page 339.
*/
- (void)appendBarcode:(ESCBarcode)type
data:(NSString *)data
justification:(NSInteger)justification
width:(NSInteger)width
height:(NSInteger)height
hri:(NSInteger)hri;
#pragma mark Macro Function Commands
/**
* page 360.
* Start or end macro
*/
- (void)defineMacro;
/**
* page 362.
* Executes a macro 'times' while 'wait_times' * 100 msec for each macro execution,using the mode specified by 'mode' as follows.
*
* @param times (1~255)
* @param waitTimes (0~255)
* @param mode (0,1)
*/
- (void)executeMacroWithTimes:(NSInteger)times
waitTimes:(NSInteger)waitTimes
mode:(NSInteger)mode;
#pragma mark Mechanism Control Commands
/**
* page 366.
* Return to homepage
*/
- (void)returnHome;
/**
* page 367. /
* Turn on/off unidirectional print mode
*
* @param mode (0~255)
*/
- (void)setUnidirectionalPrintMode:(NSInteger)mode;
/**
* page 368.
* Partial cut
*/
- (void)setPartialCut1;
/**
* page 370.
* Partial cut
*/
- (void)setPartialCut3;
/// Partial
/// 半切
- (void)setPartialCut;
/// Full
/// 全切
- (void)setFullCut;
/// 打印并半切距离
/// @param distance distance = 15mm + n * 0.0625
- (void)setPartialCutWithDistance:(NSInteger)distance;
/// 打印并全切距离
/// @param distance distance = 15mm + n * 0.0625
- (void)setFullCutWithDistance:(NSInteger)distance;
/**
* page 372.
* Set cut mode and cut the paper
*
* @param mode (0,1,48,49)
* @param distance (0~255)
*/
- (void)setCutMode:(NSInteger)mode distance:(NSInteger)distance;
/// kick Cashdrawer/弹出钱箱
/// @param number 0-2 0:1# 1:2# 2:all
- (void)kickCashdrawer:(NSInteger)number;
/// get Cashdrawer status: 1--close 0--open
- (void)getPrinterCashdrawerStatus;
// 如果打印机没有开启黑标功能,那么下面的几条指令可以帮助你
// If the printer does not have the black mark function enabled, then the following instructions can help you
#pragma mark Black mark Commmands
/// 设置是否开启黑标
/// @param status 0close 1open
- (void)setPrinterBlackMarkStatus:(NSInteger)status;
/// 设置黑标是否开启自动定位
/// @param location 0close 1open
- (void)setPrinterBlackMarkAutoLocation:(NSInteger)location;
/// 设置黑标自动定位后是否切刀
/// @param location 0close 1open
- (void)setPrinterBlackMarkCutAfterAutoLocation:(NSInteger)location;
#pragma mark Miscellaneous Commands
/**
* page 380.
* Send real-time request
*
* @param request (1~2)
*/
- (void)sendRealTimeRequest:(NSInteger)request;
/**
* page 385.
* Real-time pulse
*
* @param mode 0,1
* @param time (1~8)
*/
- (void)generatePulseWithMode:(NSInteger)mode Time:(NSInteger)time;
/**
* page 388.
* Execute power off sequence
*/
- (void)executePowerOffSequence;
/**
* page 391.
* Transmit specified status in real time
*
* @param status 1,5
*/
- (void)transmitSpecifiedStatus:(NSInteger)status;
/**
* page 396.
* Clear buffer
*/
- (void)clearBuffer;
/**
* page 405
*
* @param times (0~63)
* @param t1 (0~255)
* @param t2 (0~255)
*/
- (void)escBeepIntegratedBeeperWithTimes:(NSInteger)times T1:(NSInteger)t1 T2:(NSInteger)t2;
/**
* page 406
*
* @param a (48~51)
* @param times 0,255
* @param t1 (1~50,255)
* @param t2 (1~50)
*/
- (void)escSetIntegratedBeeperWhenOfflineFactorsOccurA:(NSInteger)a Times:(NSInteger)times T1:(NSInteger)t1 T2:(NSInteger)t2;
/**
* page 408
*
* @param times 0,255
* @param t1 (1~50,255)
* @param t2 (1~50)
*/
- (void)escSetIntegratedBeeperExceptWhenOfflineFactorsOccurWithTimes:(NSInteger)times T1:(NSInteger)t1 T2:(NSInteger)t2;
/**
* page 410.
* Select peripheral device
* 1,3 enables printer
* 2 disables printer
*
* @param mode (1~3)
*/
- (void)escSelectPeripheralDevice:(NSInteger)mode;
/**
* page 412.
* Initialize printer
*/
- (void)initializePrinter;
/**
*
* clear buffers
*/
- (void)clearPrinterBuffer;
/**
* page 413.
* Set page mode
*/
- (void)setPageMode;
/**
* page 416.
* Set standard mode
*/
- (void)setStandardMode;
/**
* page 418.
* Generate pulse pin mode
* 0,48: drawer kick-out connector pin 2
* 1,49: drawer kick-out connector pin 5
*
* @param pin_mode 0,1,48,49
* @param on_time (0~255)
* @param off_time (0~255)
*/
- (void)escGeneratePulsePinMode:(NSInteger)pin_mode ONTime:(NSInteger)on_time OFFTime:(NSInteger)off_time;
/**
* page 420.
* Execute test print
*
* @param type (0,1,2),(48,49,50)
* @param mode (1,2,3),(49,50,51),64
*/
- (void)escExecuteTestPrintType:(NSInteger)type Mode:(NSInteger)mode;
/**
* page 424. /
* Enable/disable real-time command
*
* @param cmdLength (3,5)
* @param type (1,2)
* @param mode (0,1,48,49)
*/
- (void)escSetRealTimeCommandLength:(NSInteger)cmdLength type:(NSInteger)type mode:(NSInteger)mode;
/**
* page 427.
* Request transmission of response or status
*/
- (void)escRequestTransmissionOfResponseOrStatus;
/**
* page 445.
* Select print control mode
* 0,48: print mode when power is turned on
* (1,49: mode1), (2,50:mode2), (3,51:mode3), (4,52:mode4)
*
* @param mode (0,4),(48,52)
*/
- (void)escSelectPrintControlMode:(NSInteger)mode;
/**
* page 448.
* Set print density
*
* @param density (250~255),(0~6)
*/
- (void)setDensity:(NSInteger)density;
/**
* page 451.
* Set print speed
*
* @param speed (0~11),(48~57)
*/
- (void)setSpeed:(NSInteger)speed;
/**
* page 453.
* Select number of parts for thermal head energizing
*
* @param number (0~4),(48~52),128
*/
- (void)escSelectNumbersOfPartsForThermalHeadEnergizing:(NSInteger)number;
/**
* page 456.
* Set printable area in page mode
*/
- (void)setPageAreaWithWidth:(NSInteger)width
height:(NSInteger)height
xOffset:(NSInteger)xOffset;
/**
* page 461. 线
* Draw line
*
* @param xPos (0~431)
* @param yPos (0~1199)
* @param xEnd (0~431)
* @param yEnd (0~1199)
* @param mode (1~3)
*/
- (void)appendLineWithXPos:(NSInteger)xPos
yPos:(NSInteger)yPos
xEnd:(NSInteger)xEnd
yEnd:(NSInteger)yEnd
mode:(NSInteger)mode;
/**
线
Draw line
@param lineWidth 线 width of line
@param xPos x start x
@param yPos y start y
@param xEnd x end x
@param yEnd y end y
*/
- (void)appendLineWithLineWidth:(uint8_t)lineWidth
xPos:(NSInteger)xPos
yPos:(NSInteger)yPos
xEnd:(NSInteger)xEnd
yEnd:(NSInteger)yEnd;
/**
* page 465.
* Draw rectangle
*
* @param xPos (0~431)
* @param yPos (0~1199)
* @param xEnd (0~431)
* @param yEnd (0~1199)
* @param mode (1~3)
*/
- (void)appendRectWithXPos:(NSInteger)xPos
yPos:(NSInteger)yPos
xEnd:(NSInteger)xEnd
yEnd:(NSInteger)yEnd
mode:(NSInteger)mode;
/**
Draw rectangle
@param lineWidth 线
@param xPos x
@param yPos y
@param width
@param height
*/
- (void)appendRectangleWithLineWidth:(uint8_t)lineWidth
xPos:(NSInteger)xPos
yPos:(NSInteger)yPos
width:(NSInteger)width
height:(NSInteger)height;
/**
* page 468. ID
* Transmit PrinterID
* (1,49: Printer model ID),(2,50: Type ID), (3,51: Version ID)
*
* @param id_number (1~3),(49~51)
*/
- (void)escTransmitPrinterID:(NSInteger)id_number;
/**
* page 484.
* Set horizontal vertical motion units
*
* @param horizontal (0~255)
* @param vertical (0~255)
*/
- (void)setMotionUnitsWithHorizontal:(NSInteger)horizontal vertical:(NSInteger)vertical;
/**
* page 486.
* Initialize maintenance counter
*
* @param counter (20,21,50,70)
*/
- (void)escInitializeMaintenanceCounter:(NSInteger)counter;
/**
* page 488.
* Transmit maintenance counter
*
* @param counter (20,21,50,70)
*/
- (void)escTransmitMaintenanceCounter:(NSInteger)counter;
/**
* page 493. 线
* Set online recovery wait time
*
* @param wait_time1 (0~255) default 6
* @param wait_time2 (0~255) default 0
*/
- (void)escSetOnlineRecoveryWaitTime1:(NSInteger)wait_time1 WaitTime2:(NSInteger)wait_time2;
#pragma mark Kanji Commands
/**
* page 502.
* Set Kanji print mode
*/
- (void)setKanjiWithReverse:(BOOL)reverse
doubleWidth:(BOOL)doubleWidth
doubleHeight:(BOOL)doubleHeight
underline:(BOOL)underline;
/**
* page 505.
* Set Kanji mode
*/
- (void)setKanjiMode;
/**
* page 508.
* Set Kanji font mode
*
* @param mode (0~2),(48~50)
*/
- (void)setKanjiFontMode:(NSInteger)mode;
/**
* page 510. /线
* Turn on/off Kanji underline mode
* 0,48: turn off kanji underline mode
* 1,49: turn on kanji underline mode(1-dot thick)
* 2,50: turn on kanji underline mode(2-dots thick)
*
* @param underline (0~2),(48~50)
*/
- (void)setKanjiUnderline:(NSInteger)underline;
/**
* page 512.
* Cancel Kanji mode
*/
- (void)cancelKanjiMode;
/**
* page 514.
* Define user-defined Kanji character
*
* @param first (119,236,254)
* @param second (33~126),(64~126),(128~158),(161~254)
*/
- (void)defineKanji:(NSData *)data first:(NSInteger)first second:(NSInteger)second;
/**
* page 518.
* Set Kanji code system
* 0,48 JIS code
* 1,49 SHIFT JIS code
*
* @param system (0,1),(48,49)
*/
- (void)setKanjiCodeSystem:(NSInteger)system;
/**
* page 520.
* Set Kanji character spacing
* @param left (0~32) default:0
* @param right (0~32) default:0
*/
- (void)setKanjiSpacingWithLeft:(NSInteger)left right:(NSInteger)right;
/**
* page 522. /
* Turn on/off Kanji quadruple height and width mode
*
* @param mode (0~255)
*/
- (void)setKanjiQuadrupleMode:(NSInteger)mode;
/**
* page 523.
* Cancel user-defined Kanji character
* @param first (119,236,254)
* @param second (33~126),(64~126),(128~158),(161~254)
*/
- (void)cancelKanjiDefineWithFirst:(NSInteger)first second:(NSInteger)second;
#pragma mark Two Dimension Code Commands
/**
* Document 14.1
*
* @param data data String
* @param row 0, 3 to 90
* @param column 0 to 30
* @param width 2 to 8
* @param rowHeight 2 to 8
* @param eccMode 48 to 49
* @param eccLevel 48 to 50
* @param option 0 to 1
*/
- (void)appendPDF417Data:(NSString *)data
row:(NSInteger)row
column:(NSInteger)column
width:(NSInteger)width
rowHeight:(NSInteger)rowHeight
eccMode:(NSInteger)eccMode
eccLevel:(NSInteger)eccLevel
option:(NSInteger)option;
/**
* page 549.
* Transmit PDF417 symbol data size in symbol storage area
*/
- (void)transmitPDF417SymbolDataSize;
/// QRCode
/// @param data 二维码数据
/// @param justification 对齐方式 取值0,1,2 : 左、中、右
/// @param leftMargin 左间距
/// @param eccLevel 纠错等级取值48~51: Level L,M,Q,H
/// @param model 二维码样式取值49,50 : 两种样式
/// @param size 大小取值1~16
- (void)appendQRCodeData:(NSString *)data
justification:(NSInteger)justification
leftMargin:(NSInteger)leftMargin
eccLevel:(NSInteger)eccLevel
model:(NSInteger)model
size:(NSInteger)size;
/**
* page 562. :
* QR code: transmit QR code symbol data size in symbol storage area
*/
- (void)transmitQRCodeSymbolDataSize;
/**
* Document 14.3
*
* @param data maxicode
*/
- (void)appendMaxiCodeData:(NSString *)data mode:(NSInteger)mode;
/**
* page 570.
* Transmit maxi code symbol data size in symbol storage area
*/
- (void)transmitMaxiCodeSymbolDataSize;
/**
* Document 14.4
*
* @param data RSS-2D data
* @param mode 72,73,76
* @param moduleWidth 2 to 8
* @param maxWidth 2 to 8
*/
- (void)appendRSS2Data:(NSData *)data
mode:(NSInteger)mode
moduleWidth:(NSInteger)moduleWidth
maxWidth:(NSInteger)maxWidth;
/**
* page 579.
* Transmit RSS2 symbol data size in symbol storage area
*/
- (void)transmitRSS2SymbolDataSize;
/**
* Document 14.5
*
* @param data composite symbol data
* @param mode 48 to 49
* @param type 65 to 77
* @param moduleWidth 2 to 8
* @param maxWidth 2 to 8
* @param hriFont 0 to 3, 48 to 51
*/
- (void)appendCompositeSymbolData:(NSData *)data
mode:(NSInteger)mode
type:(NSInteger)type
moduleWidth:(NSInteger)moduleWidth
maxWidth:(NSInteger)maxWidth
hriFont:(NSInteger)hriFont;
/**
* page 600.
* Transmit composite symbol data size in symbol storage area
*/
- (void)transmitCompositeSymbolDataSize;
#pragma mark Customize Commands
/**
* page 606. NV
* Write NV user memory
* @param address (0~1023)
*/
- (void)writeNVUserMemory:(NSInteger)address data:(NSData *)data;
/**
* page 608. NV
* Read NV user memory
* @param address (0~1023)
*/
- (void)readNVUserMemory:(NSInteger)address length:(NSInteger)length;
/**
* page 615.
* Delete specified record data
*
* @param mode (0,48)
* @param key (32~126)
* @param key2 (32~126)
*/
- (void)deleteRecordWithMode:(NSInteger)mode key:(NSInteger)key key2:(NSInteger)key2;
/**
* page 616.
* Store specified record data
*
* @param mode (0,48)
* @param key (32~126)
* @param key2 (32~126)
*/
- (void)storeRecordWithMode:(NSInteger)mode key:(NSInteger)key key2:(NSInteger)key2 data:(NSData *)data;
/**
* page 618.
* Transmit specified record data
*
* @param mode (0,48)
* @param key (32~126)
* @param key2 (32~126)
*/
- (void)transmitDataInRecordWithMode:(NSInteger)mode key:(NSInteger)key key2:(NSInteger)key2;
/**
* page 620. NV使
* Transmit current used capacity of NV memory
*
* @param mode 3,51
*/
- (void)transmitNVMemoryUsedCapacityWithMode:(NSInteger)mode;
/**
* page 621. NV
* Transmit remaining capacity of NV memory
*
* @param mode 4,52
*/
- (void)transmitNVMemoryRemainingCapacityWithMode:(NSInteger)mode;
/**
* page 622.
* Transmit key code list
*
* @param mode 5,53
*/
- (void)transmitKeyCodeListWithMode:(NSInteger)mode;
/**
* page 624. NV
* Delete all the NV memory
*
* @param mode 6,54
*/
- (void)deleteNVMemoryAllWithMode:(NSInteger)mode;
/**
* page 631.
* Change user setting mode
*/
- (void)changeUserSettingMode;
/**
* page 632.
* End user setting mode
*/
- (void)endUserSettingMode;
/**
* page 633.
* Change memory switch
*
* @param data (0~255)
*/
- (void)escChangeMemorySwitchData:(NSData *)data;
/**
* page 646.
* Transmit memory switch setting
*
* @param a (1,2,8)
*/
- (void)escTransmitMemorySwitchSettingA:(NSInteger)a;
/**
* page 648.
* Set customized setting values
*/
- (void)escSetCustomizedSettingValuesData:(NSData *)data;
/**
* page 663.
* Transmit customized setting values
*
* @param a (5,6,97,116,118)
*/
- (void)escTransmitCustomizedSettingValuesA:(NSInteger)a;
/**
* page 666.
* Copy user-defined page
*
* @param font_number (10,12,17,18)
* @param d1 (30,31)
* @param d2 (30,31) d1 can't be euqual o d2!!
*/
- (void)escCopyUserDefinedPageWithFontNumber:(NSInteger)font_number D1:(NSInteger)d1 D2:(NSInteger)d2;
/**
* page 669. ()
* Define data for character code page (column format)
*
* @param c1 (128~255)
* @param c2 (128~255)
*/
- (void)escDefineColumnFormatDataForCharacterCodePageY:(NSInteger)y C1:(NSInteger)c1 C2:(NSInteger)c2 Data:(NSData *)data;
/**
* page 671. ()
* Define data for character code page (raster format)
*
* @param c1 (128~255)
* @param c2 (128~255)
*/
- (void)escDefineRasterFormatDataForCharacterrCodePageX:(NSInteger)x C1:(NSInteger)c1 C2:(NSInteger)c2 Data:(NSData *)data;
/**
* page 673.
* Delete data for character code page
*
* @param c1 (128~255)
* @param c2 (128~255)
*/
- (void)escDeleteDataForChracterCodePageC1:(NSInteger)c1 C2:(NSInteger)c2;
/**
* page 674.
* Set configuration item for serial interface
*
* @param a (1~4),depend on data
*/
- (void)escSetConfigurationItemForSerialInterfaceA:(NSInteger)a Data:(NSData *)data;
/**
* page 678.
* Transmit configuration item for serial interface
*
* @param pl (2)
* @param ph (0)
* @param a (1~4)
*/
- (void)escTransmitConfigurationItemForSerialInterfacePL:(NSInteger)pl PH:(NSInteger)ph A:(NSInteger)a;
/**
* page 680.
* Set configuration item for Bluetooth interface
* @param a (49,65)
*/
- (void)escSetConfigurationItemForBluetoothInterfaceA:(NSInteger)a Data:(NSData *)data;
/**
* page 682.
* Transmit configuration item for Bluetooth interface
*
* @param a (48,49,65)
*/
- (void)escTransmitConfigurationItemForBluetoothInterfaceA:(NSInteger)a;
/**
* page 685.
* Delete paper layout
*/
- (void)escDeletePaperLayout;
/**
* page 686.
* Set paper layout
* @param p (9~36)
* @param sa (48,49,64)
* @param sb (135~3000)
* @param sc (25~100)
* @param sd (0~3000)
* @param se (0~3000)
* @param sf (38~3000)
* @param sg (when sa = '48' or '49':27~507),(when sa = '64':47~507)
* @param sh (when sa = '48' or '49':240~720),(when sa = '64':240~700)
*/
- (void)escSetPaperLayoutP:(NSInteger)p SA:(NSInteger)sa SB:(NSInteger)sb SC:(NSInteger)sc
SD:(NSInteger)sd SE:(NSInteger)se SF:(NSInteger)sf SG:(NSInteger)sg SH:(NSInteger)sh;
/**
* page 692.
* Transmit paper layout information
*
* @param n 64,80
*/
- (void)escTransmitPaperLayoutInformation:(NSInteger)n;
/**
* page 701.
* Save setting values from work area into storage area
*
* @param fn (1,49)
* @param m (1,49)
*/
- (void)escSaveSettingValuesFromWorkAreaIntoStorageAreaFN:(NSInteger)fn M:(NSInteger)m;
/**
* page 702.
* Load setting values stored in storage area to work area
*
* @param fn (2,50)
* @param m (0,1,48,49)
*/
- (void)escLoadSettingValuesStoredInStorageAreaToWorkAreaFN:(NSInteger)fn M:(NSInteger)m;
/**
* page 703.
* Select setting values loaded to work area after initialization process
*
* @param fn (3,51)
* @param m (0,1,48,49)
*/
- (void)escSelectSettingValuesLoadedToWorkAreaAfterInitializationProcessFN:(NSInteger)fn M:(NSInteger)m;
#pragma mark Counter Printing Commands
/**
* page 705.
* Select counter print mode
*
* @param digits (2~5)
* @param justification (0~2),(48~50)
*/
- (void)escSelectCounterPrintModeWithDigits:(NSInteger)digits Justification:(NSInteger)justification;
/**
* page 707.
* Select counter mode
*
* @param counting_mode (0~65535)
* @param repetition (0~65535)
*/
- (void)escSelectCounterModeA_MinimumValue:(NSInteger)minimum_value
MaximumValue:(NSInteger)maximum_value
CountingMode:(NSInteger)counting_mode
Repetition:(NSInteger)repetition;
/**
* page 709.
* Set counter
*
* @param counter (0~65535) default:1
*/
- (void)escSetCounter:(NSInteger)counter;
/**
* page 710.
* Select counter mode
*
* @param sa (0~65535) default:1
* @param sb (0~65535) default:65535
* @param sn (0~255) default:1
* @param sr (0~255) default:1
* @param sc (0~65535) default:1
*/
- (void)escSelectCounterModeB_SA:(NSInteger)sa SB:(NSInteger)sb SN:(NSInteger)sn SR:(NSInteger)sr SC:(NSInteger)sc;
/**
* page 713.
* Print counter
*/
- (void)escPrintCounter;
#pragma mark Printing Paper Commands
/**
* page 720.
* Paper layout setting
*
* @param p (8~26)
* @param sm (0~3) mode
* @param sa (0),(284~1550)
* @param sb (-150,-1500)
* @param sc (-290,-50)
* @param sd (0,-15)
* @param se (-15,-15)
* @param sf (290,-600)
*/
- (void)escPaperLayoutSettingP:(NSInteger)p SM:(NSInteger)sm SA:(NSInteger)sa
SB:(NSInteger)sb SC:(NSInteger)sc SD:(NSInteger)sd SE:(NSInteger)se SF:(NSInteger)sf;
/**
* page 729.
* Transmit paper layout setting information
*
* @param n (64,80)
*/
- (void)escPaperLayoutInformationTransmissionN:(NSInteger)n;
/**
* page 732.
* Transmit current positioning information
*
* @param m 48
*/
- (void)escTransmitPositioningInformationM:(NSInteger)m;
/**
* pag 737.
* Feed paper to label peeling position
*
* @param m (48,49)
*/
- (void)escFeedPaperToLabelPeelingPositionM:(NSInteger)m;
/**
* page 740.
* Feed paper to cutting position
*
* @param m (48,49)
*/
- (void)escFeedPaperToCuttingPositionM:(NSInteger)m;
/**
* page 742.
* Feed paper to print starting position
*
* @param m (48,49,50)
*/
- (void)escFeedPaperToPrintStartingPositionM:(NSInteger)m;
/**
* page 744.
* Paper layout error special margin setting
*
* @param p (2,3)
* @param sn (80)
*/
- (void)escPaperLayoutErrorSpecialMarginSettingP:(NSInteger)p SN:(NSInteger)sn;
@end