POSSDK.h 213 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989
  1. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2. /// @~English
  3. /// @file: POSSDKDLL.h
  4. /// @brief: Declares the bpladll class
  5. ///
  6. ///
  7. /// Copyright SNBC Corp. 2019
  8. /// ALL RGIHTS RESERVED.
  9. ///
  10. /// @~Chinese
  11. /// @file: POSSDKDLL.h
  12. /// @brief:
  13. ///
  14. ///
  15. /// 山东新北洋信息技术有限公司 2019\n
  16. /// 所有权利保留。
  17. ////////////////////////////////////////////////////////////////////////////////////////////////////
  18. #pragma once
  19. // 接口函数导出形式定义
  20. #ifndef POSSDKCALL_MODE
  21. #ifdef _WIN32
  22. /// A macro that defines possdkcall mode
  23. #define POSSDKCALL_MODE __stdcall
  24. #else
  25. #define POSSDKCALL_MODE
  26. #endif
  27. #endif
  28. /**************************************************************************************************************************
  29. * 宏定义
  30. ************************************************************************************************************************/
  31. #ifndef POSSDK_DATA_TYPE_DEF
  32. #define POSSDK_DATA_TYPE_DEF
  33. ////////////////////////////////////////////////////////////////////////////////////////////////////
  34. /// type of return handle
  35. /// @~English
  36. /// Returns the handle type
  37. ///
  38. ///
  39. /// @~Chinese
  40. /// 返回句柄类型
  41. ////////////////////////////////////////////////////////////////////////////////////////////////////
  42. typedef void* DEVICEHANDLE;
  43. ////////////////////////////////////////////////////////////////////////////////////////////////////
  44. /// @~English
  45. /// @brief Success
  46. /// @~Chinese
  47. /// @brief 无IO通讯
  48. ////////////////////////////////////////////////////////////////////////////////////////////////////
  49. const int PORT_NONE = 0;
  50. ////////////////////////////////////////////////////////////////////////////////////////////////////
  51. /// @~English
  52. /// @brief Serial port
  53. /// @~Chinese
  54. /// @brief 串口
  55. ////////////////////////////////////////////////////////////////////////////////////////////////////
  56. const int PORT_SERIAL = 1;
  57. ////////////////////////////////////////////////////////////////////////////////////////////////////
  58. /// @~English
  59. /// @brief API mode
  60. /// @~Chinese
  61. /// @brief API模式
  62. ////////////////////////////////////////////////////////////////////////////////////////////////////
  63. const int PORT_USBDEVICE_API = 2;
  64. ////////////////////////////////////////////////////////////////////////////////////////////////////
  65. /// @~English
  66. /// @brief USB class mode
  67. /// @~Chinese
  68. /// @brief USB 类模式
  69. ////////////////////////////////////////////////////////////////////////////////////////////////////
  70. const int PORT_USBDEVICE_CLASS = 3;
  71. ////////////////////////////////////////////////////////////////////////////////////////////////////
  72. /// @~English
  73. /// @brief Net port
  74. /// @~Chinese
  75. /// @brief 网口
  76. ////////////////////////////////////////////////////////////////////////////////////////////////////
  77. const int PORT_ETHERNET = 4;
  78. ////////////////////////////////////////////////////////////////////////////////////////////////////
  79. /// @~English
  80. /// @brief Lpt port
  81. /// @~Chinese
  82. /// @brief 并口
  83. ////////////////////////////////////////////////////////////////////////////////////////////////////
  84. const int PORT_LPT = 5;
  85. ////////////////////////////////////////////////////////////////////////////////////////////////////
  86. /// @~English
  87. /// @brief Print Driver
  88. /// @~Chinese
  89. /// @brief 打印机驱动
  90. ////////////////////////////////////////////////////////////////////////////////////////////////////
  91. const int PORT_DRIVER = 6;
  92. ////////////////////////////////////////////////////////////////////////////////////////////////////
  93. /// @~English
  94. /// @brief Bluetooth
  95. /// @~Chinese
  96. /// @brief 蓝牙
  97. ////////////////////////////////////////////////////////////////////////////////////////////////////
  98. const int PORT_BLT = 7;
  99. ////////////////////////////////////////////////////////////////////////////////////////////////////
  100. /// @~English
  101. /// @brief Bluetooth_MFI
  102. /// @~Chinese
  103. /// @brief 蓝牙MFI
  104. ////////////////////////////////////////////////////////////////////////////////////////////////////
  105. const int PORT_BLT_MFI = 8;
  106. ////////////////////////////////////////////////////////////////////////////////////////////////////
  107. /// @~English
  108. /// @brief Success
  109. /// @~Chinese
  110. /// @brief 成功
  111. ////////////////////////////////////////////////////////////////////////////////////////////////////
  112. const int ERR_SUCCESS = 0;
  113. ////////////////////////////////////////////////////////////////////////////////////////////////////
  114. /// @~English
  115. /// @brief Fail
  116. /// @~Chinese
  117. /// @brief 失败
  118. ////////////////////////////////////////////////////////////////////////////////////////////////////
  119. const int ERR_FAIL = -1;
  120. ////////////////////////////////////////////////////////////////////////////////////////////////////
  121. /// @~English
  122. /// @brief Invalid handle
  123. /// @~Chinese
  124. /// @brief 无效句柄
  125. ////////////////////////////////////////////////////////////////////////////////////////////////////
  126. const int ERR_HANDLE = -2;
  127. ////////////////////////////////////////////////////////////////////////////////////////////////////
  128. /// @~English
  129. /// @brief Invalid parameter
  130. /// @~Chinese
  131. /// @brief 无效参数
  132. ////////////////////////////////////////////////////////////////////////////////////////////////////
  133. const int ERR_PARAMATER = -3;
  134. ////////////////////////////////////////////////////////////////////////////////////////////////////
  135. /// @~English
  136. /// @brief Parameter file error
  137. /// @~Chinese
  138. /// @brief 参数文件错误
  139. ////////////////////////////////////////////////////////////////////////////////////////////////////
  140. const int ERR_FILE = -4;
  141. ////////////////////////////////////////////////////////////////////////////////////////////////////
  142. /// @~English
  143. /// @brief Error reading file or data
  144. /// @~Chinese
  145. /// @brief 读取文件或数据错误
  146. ////////////////////////////////////////////////////////////////////////////////////////////////////
  147. const int ERR_READ = -5;
  148. ////////////////////////////////////////////////////////////////////////////////////////////////////
  149. /// @~English
  150. /// @brief Error in issuing file or data
  151. /// @~Chinese
  152. /// @brief 下发文件或数据错误
  153. ////////////////////////////////////////////////////////////////////////////////////////////////////
  154. const int ERR_WRITE = -6;
  155. ////////////////////////////////////////////////////////////////////////////////////////////////////
  156. /// @~English
  157. /// @brief This feature is not supported
  158. /// @~Chinese
  159. /// @brief 此功能不支持
  160. ////////////////////////////////////////////////////////////////////////////////////////////////////
  161. const int ERR_NOT_SUPPORT = -7;
  162. ////////////////////////////////////////////////////////////////////////////////////////////////////
  163. /// @~English
  164. /// @brief Bitmap error
  165. /// @~Chinese
  166. /// @brief 位图错误
  167. ////////////////////////////////////////////////////////////////////////////////////////////////////
  168. const int ERR_BITMAP_INVAILD = -8;
  169. ////////////////////////////////////////////////////////////////////////////////////////////////////
  170. /// @~English
  171. /// @brief Dynamic library failed to load
  172. /// @~Chinese
  173. /// @brief 动态库加载失败
  174. ////////////////////////////////////////////////////////////////////////////////////////////////////
  175. const int ERR_LOADDLL_FAILURE = -9;
  176. ////////////////////////////////////////////////////////////////////////////////////////////////////
  177. /// @~English
  178. /// @brief Firmware does not support
  179. /// @~Chinese
  180. /// @brief 固件不支持
  181. ////////////////////////////////////////////////////////////////////////////////////////////////////
  182. const int ERR_FIRNOSUPPORT = -10;
  183. //在此继续添加错误.........
  184. ////////////////////////////////////////////////////////////////////////////////////////////////////
  185. /// @~English
  186. /// @brief An unknown error
  187. /// @~Chinese
  188. /// @brief 未知错误
  189. ////////////////////////////////////////////////////////////////////////////////////////////////////
  190. const int ERR_UNKOWN_ERROR = -127;
  191. #endif
  192. /**************************************************************************************************************************
  193. * 参数设置
  194. ************************************************************************************************************************/
  195. /// TCP协议
  196. const int TCP_PROTOCOL = 0;
  197. /// UDP协议
  198. const int UDP_PROTOCOL = 1;
  199. /// 不广播
  200. const int NOTBROADCAST = 0;
  201. /// 广播
  202. const int BROADCAST = 1;
  203. #ifdef __cplusplus
  204. /// .
  205. extern "C"
  206. {
  207. #endif // __cplusplus
  208. //*****************API function************************************************
  209. //通讯
  210. ////////////////////////////////////////////////////////////////////////////////////////////////////
  211. /// @~English
  212. /// @brief Enumerate device names
  213. ///
  214. /// @param [in] nOperationType Port type, The effective parameters are as follows:
  215. /// |Valid value|Meaning|
  216. /// |---------|---------|
  217. /// | ::PORT_USBDEVICE_CLASS |USB Class mode|
  218. /// | ::PORT_USBDEVICE_API |USB API mode|
  219. /// | ::PORT_SERIAL |Serial port|
  220. /// | ::PORT_ETHERNET |Network port|
  221. /// | ::PORT_DRIVER |Printer driver|
  222. /// | ::PORT_BLT |Bluetooth|
  223. /// | ::PORT_BLT_MFI |Bluetooth MFI|
  224. /// | ::PORT_LPT |Lpt port|
  225. /// @param [out] szDeviceNameBuf The buffer of name list each name terminator with \@, This terminator is not used as the name information for the enumeration. It is only used to divide multiple name applications.Such as "BTP-L540@BTP-L520@".
  226. /// @param [in] nBufLen Buffer size must match the name list buffer size.
  227. /// @param [out] npNumber The number of name list.
  228. ///
  229. /// <b>Sample code\n</b>
  230. /// See details @ref EG_EnumDeviceInfo
  231. ///
  232. /// @return
  233. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  234. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  235. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  236. ///
  237. /// @~Chinese
  238. /// @brief 枚举设备名称
  239. ///
  240. /// @param [in] nOperationType 端口类型,有效参数如下:
  241. /// |有效值|含义|
  242. /// |---------|---------|
  243. /// | ::PORT_USBDEVICE_CLASS |USB 类模式|
  244. /// | ::PORT_USBDEVICE_API |USB API模式|
  245. /// | ::PORT_SERIAL |串口|
  246. /// | ::PORT_ETHERNET |网口|
  247. /// | ::PORT_DRIVER |打印机驱动|
  248. /// | ::PORT_BLT |蓝牙|
  249. /// | ::PORT_BLT_MFI |蓝牙 MFI|
  250. /// | ::PORT_LPT |并口|
  251. /// @param [out] szDeviceNameBuf 名称列表缓冲区 每个名称结束符为\@,此结束符不作为枚举的名称信息,只用于划分多个名称应用。如“BTP-L540\@BTP-L520\@”。
  252. /// @param [in] nBufLen 缓冲区大小 必须与名称列表缓冲区大小一致。
  253. /// @param [out] npNumber 名称列表数量。
  254. ///
  255. /// <b>示例代码\n</b>
  256. /// 详见 @ref EG_EnumDeviceInfo
  257. ///
  258. /// @return
  259. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  260. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  261. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  262. ////////////////////////////////////////////////////////////////////////////////////////////////////
  263. ///
  264. int POSSDKCALL_MODE EnumDeviceInfo(int nOperationType, char *szDeviceNameBuf, int nBufLen, int *npNumber);
  265. ////////////////////////////////////////////////////////////////////////////////////////////////////
  266. /// @~English
  267. /// @brief Initializes the device
  268. ///
  269. /// @param [in] szDeviceName Device name, According to the different printer input specific character string.
  270. /// Btp-s80 and other receipt printers use "POS", BK series unit printers use "KIOSK", BT series unit printers use "TKIOSK", BTP_M300 and other impact printers use "IMPACT".
  271. ///
  272. /// <b>Remark\n</b>
  273. /// 1.iOS only support POS and IMPACT machine.
  274. ///
  275. /// @return
  276. /// Success:Returns the device handle,this handle is the first parameter of the execution function interface.\n
  277. /// Fail:\n
  278. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  279. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  280. ///
  281. /// @~Chinese
  282. /// @brief 初始化设备
  283. ///
  284. /// @param [in] szDeviceName 设备名称,根据不同的打印机输入特定的字符串。
  285. /// BTP-S80等收据类打印机使用“POS”,BK系列单元类打印机使用“KIOSK”,BT系列单元类打印机使用“TKIOSK”,BTP_M300等针打打印机使用“IMPACT”。
  286. ///
  287. /// <b>备注\n</b>
  288. /// 1、iOS只支持POS和IMPACT类设备。
  289. ///
  290. /// @return
  291. /// 成功:返回设备句柄,此句柄为执行功能接口的第一个参数。\n
  292. /// 失败:\n
  293. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  294. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  295. ////////////////////////////////////////////////////////////////////////////////////////////////////
  296. DEVICEHANDLE POSSDKCALL_MODE Init(char *szDeviceName);
  297. ////////////////////////////////////////////////////////////////////////////////////////////////////
  298. /// @~English
  299. ///
  300. /// @brief Open serial port
  301. ///
  302. /// @param hDev The device handle.
  303. /// @param [in] szName The name of serial port, such as "COM1", "COM2", "COM3", "COM4".
  304. /// @param nComBaudrate The com baud rate. Can be these values:2400,4800,9600,19200,38400,57600,115200etc.
  305. /// The baud rate value is related to the printer port parameters, the maximum should not exceed 256000.
  306. /// @param nComDataBits The com data bits. Valid values are 4,5,6,7,8. The value is related to the printer port parameters.
  307. /// @param nComStopBits The com stop bits.
  308. /// |Valid value|Actual value|
  309. /// |---------|---------|
  310. /// |0 |1|
  311. /// |1 |1.5|
  312. /// |2 |2|
  313. /// @param [in] nComParity The parity method for the specifies serial port.\n
  314. /// |Valid value|Actual value|
  315. /// |---------|---------|
  316. /// |0 |No checkout|
  317. /// |1 |Odd parity|
  318. /// |2 |Parity checking|
  319. /// |3 |Mark inspection|
  320. /// |4 |empty-cell test|
  321. /// @param [in] nParam The flow control mode of the specify serial port.
  322. /// |Valid value|Actual value|
  323. /// |---------|---------|
  324. /// |0 |DTR/DSR|
  325. /// |1 |RTS/CTS|
  326. /// |2 |XON/XOFF|
  327. /// |3 |NULL|
  328. ///
  329. /// @return
  330. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  331. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  332. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  333. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  334. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  335. ///
  336. /// @~Chinese.
  337. ///
  338. /// @brief 打开串口设备
  339. ///
  340. /// @param [in] hDev 设备句柄。
  341. /// @param [in] szName 串口名称,如“COM1”,“COM2”,“COM3”,“COM4”。
  342. /// @param [in] nComBaudrate 指定串口的波特率(bps)。 可以为以下值之一:
  343. /// 2400,4800,9600,19200,38400,57600,115200等。
  344. /// 具体的值与打印机的端口参数有关,不过最大不应超过256000。
  345. /// @param [in] nComDataBits 指定串口通讯时的数据位数。有效值为4、5、6、7、8。具体的值与打印机的端口参数有关。
  346. /// @param [in] nComStopBits 指定串口通讯时的数据停止位数。
  347. /// |有效值|实际值|
  348. /// |---------|---------|
  349. /// |0 |1|
  350. /// |1 |1.5|
  351. /// |2 |2|
  352. /// @param [in] nComParity 指定串口的奇偶校验方法。\n
  353. /// |有效值|实际值|
  354. /// |---------|---------|
  355. /// |0 |无校验|
  356. /// |1 |奇校验|
  357. /// |2 |偶校验|
  358. /// |3 |标志检验|
  359. /// |4 |空格检验|
  360. /// @param [in] nParam 指定串口的流控制(握手)方式、或表示通讯方式。
  361. /// |有效值|实际值|
  362. /// |---------|---------|
  363. /// |0 |DTR/DSR|
  364. /// |1 |RTS/CTS|
  365. /// |2 |XON/XOFF|
  366. /// |3 |无|
  367. ///
  368. /// @return
  369. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  370. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  371. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  372. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  373. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  374. ////////////////////////////////////////////////////////////////////////////////////////////////////
  375. int POSSDKCALL_MODE OpenCOMPort(DEVICEHANDLE hDev, char *szName, int nComBaudrate, int nComDataBits, int nComStopBits, int nComParity, int nParam);
  376. ////////////////////////////////////////////////////////////////////////////////////////////////////
  377. /// @~English
  378. ///
  379. /// @brief Opens lpt port device
  380. ///
  381. /// @param [in] hDev Device handle.
  382. /// @param [in] szName Lpt port name, such as:"LPT1","LPT2","LPT3".
  383. ///
  384. /// @return
  385. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  386. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  387. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  388. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  389. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  390. ///
  391. /// @~Chinese
  392. ///
  393. /// @brief 打开字节并口设备
  394. ///
  395. /// @param [in] hDev 设备句柄。
  396. /// @param [in] szName 字节并口名称,如:“LPT1”,“LPT2”,“LPT3”。
  397. ///
  398. /// @return
  399. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  400. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  401. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  402. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  403. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  404. ////////////////////////////////////////////////////////////////////////////////////////////////////
  405. int POSSDKCALL_MODE OpenLPTPort(DEVICEHANDLE hDev, char *szName);
  406. ////////////////////////////////////////////////////////////////////////////////////////////////////
  407. ///
  408. /// @~English
  409. ///
  410. /// @brief Opens USB API mode device
  411. ///
  412. /// @param hDev Device handle.
  413. /// @param nDeviceId Identifier for the device.Range: must be greater than -1.
  414. ///
  415. ///
  416. /// <b>Remark\n</b>
  417. /// 1.The identifier can be viewed by "register-HKEY_LOCAL_MACHINE--SOFTWARE--BEIYANG--PRINTERPORT"\n
  418. /// 2.When nDeviceId equals -1, opens the currently connected device by default.
  419. ///
  420. /// @return
  421. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  422. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  423. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  424. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  425. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  426. ///
  427. /// @~Chinese
  428. ///
  429. /// @brief 打开USB API模式设备
  430. ///
  431. /// @param [in] hDev 设备句柄。
  432. /// @param [in] nDeviceId 设备内部ID号,范围:必须大于-1。
  433. ///
  434. ///
  435. /// <b>备注\n</b>
  436. /// 1、内部ID号可通过"注册表-HKEY_LOCAL_MACHINE--SOFTWARE--BEIYANG--PRINTERPORT"查看。\n
  437. /// 2、此功能nDeviceId等于-1时,默认打开当前已连接的设备。
  438. ///
  439. /// @return
  440. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  441. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  442. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  443. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  444. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  445. ////////////////////////////////////////////////////////////////////////////////////////////////////
  446. int POSSDKCALL_MODE OpenUsbApiPort(DEVICEHANDLE hDev, int nDeviceId);
  447. ////////////////////////////////////////////////////////////////////////////////////////////////////
  448. /// @~English
  449. ///
  450. /// @brief Opens USB class mode device
  451. ///
  452. /// @param [in] hDev Device handle.
  453. /// @param [in] szName The printer name, it can be viewed by device enumeration interface or computer device and printer page.
  454. /// @param [in] nIsSplitStatus Automatic status returns whether to split. When value is 1, the AutoQueryStatus interface is not available.
  455. /// |Valid value|Actual value|
  456. /// |---------|---------|
  457. /// |0 |unsplit|
  458. /// |1 |split|
  459. ///
  460. /// @return
  461. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  462. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  463. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  464. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  465. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  466. ///
  467. /// @~Chinese
  468. ///
  469. /// @brief 打开USB 类模式设备
  470. ///
  471. /// @param [in] hDev 设备句柄。
  472. /// @param [in] szName 打印机名称,可通过枚举设备接口查看或者电脑的设备和打印机页面。
  473. /// @param [in] nIsSplitStatus 自动状态返回是否拆分。当取值为1时,AutoQueryStatus 接口无法使用。
  474. /// |有效值|实际值|
  475. /// |---------|---------|
  476. /// |0 |不拆分|
  477. /// |1 |拆分|
  478. ///
  479. /// @return
  480. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  481. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  482. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  483. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  484. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  485. ////////////////////////////////////////////////////////////////////////////////////////////////////
  486. int POSSDKCALL_MODE OpenUsbClassPort(DEVICEHANDLE hDev, char *szName, int nIsSplitStatus);
  487. ////////////////////////////////////////////////////////////////////////////////////////////////////
  488. /// @~English
  489. /// @brief Opens net port device(by enumeration of device names)
  490. ///
  491. /// @param [in] hDev Device handle.
  492. /// @param [in,out] szName Enumeration of device names.
  493. ///
  494. /// @return
  495. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  496. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  497. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  498. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  499. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  500. ///
  501. /// @~Chinese
  502. /// @brief 打开网口设备(通过枚举的设备名称)
  503. ///
  504. /// @param [in] hDev 设备句柄。
  505. /// @param [in] szName 枚举的设备名称。
  506. ///
  507. ///
  508. /// @return
  509. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  510. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  511. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  512. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  513. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  514. ////////////////////////////////////////////////////////////////////////////////////////////////////
  515. int POSSDKCALL_MODE OpenNetPortByName(DEVICEHANDLE hDev, char *szName);
  516. ////////////////////////////////////////////////////////////////////////////////////////////////////
  517. /// @~English
  518. /// @brief Opens net port device(by IP address)
  519. ///
  520. /// @param [in] hDev Device handle.
  521. /// @param [in] szNetIP The IP address of Device, such as:"192.168.1.251".
  522. /// @param [in] nPort The port, such as :"9100".
  523. /// @param [in] nProtocalType Type of the protocal, 0:TCP,1:UDP.
  524. /// @param [in] nBroadcast 0:Don't broadcast, 1:Broadcast.
  525. ///
  526. /// <b>Remark\n</b>
  527. /// This interface supports JK-E02,JK-E04,JK-E05,JK-W01,JK-W03 network board.\n
  528. ///
  529. /// @return
  530. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  531. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  532. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  533. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  534. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  535. ///
  536. /// @~Chinese
  537. /// @brief 打开网口设备(通过IP地址)
  538. ///
  539. /// @param [in] hDev 设备句柄。
  540. /// @param [in] szNetIP 设备IP地址,如:“192.168.1.251”。
  541. /// @param [in] nPort 设备端口号,如:“9100”。
  542. /// @param [in] nProtocalType 协议类型,0:TCP,1:UDP。
  543. /// @param [in] nBroadcast 0:不广播,1;广播。
  544. ///
  545. /// <b>备注\n</b>
  546. /// 此接口支持JK-E02、JK-E04、JK-E05、JK-W01、JK-W03网口板。\n
  547. ///
  548. /// @return
  549. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  550. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  551. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  552. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  553. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  554. ////////////////////////////////////////////////////////////////////////////////////////////////////
  555. int POSSDKCALL_MODE OpenNetPort(DEVICEHANDLE hDev, char *szNetIP, int nPort, int nProtocalType, int nBroadcast);
  556. ////////////////////////////////////////////////////////////////////////////////////////////////////
  557. /// @~English
  558. /// @brief Opens blue tooth port device(by enumeration of device names)
  559. ///
  560. /// @param [in] hDev Device handle.
  561. /// @param [in,] szName Enumeration of device names.
  562. ///
  563. /// @return
  564. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  565. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  566. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  567. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  568. ///
  569. /// @~Chinese
  570. ///
  571. /// @brief 打开蓝牙设备(通过枚举的设备名称)
  572. ///
  573. /// @param [in] hDev 设备句柄。
  574. /// @param [in] szName 枚举的设备名称。
  575. ///
  576. /// @return
  577. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  578. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  579. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  580. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  581. ////////////////////////////////////////////////////////////////////////////////////////////////////
  582. int POSSDKCALL_MODE OpenBlueToothPortByName(DEVICEHANDLE hDev, char *szName);
  583. ////////////////////////////////////////////////////////////////////////////////////////////////////
  584. /// @~English
  585. /// @brief Opens blue tooth port device(by MAC address)
  586. ///
  587. /// @param [in] hDev Device handle.
  588. /// @param [in] szMACAddress Device MAC address, such as:"00:15:5:81:DF:F4:5B".
  589. ///
  590. /// @return
  591. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  592. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  593. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  594. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  595. ///
  596. /// @~Chinese
  597. ///
  598. /// @brief 打开蓝牙设备(通过MAC地址)
  599. ///
  600. /// @param [in] hDev 设备句柄。
  601. /// @param [in] szMACAddress 设备MAC地址,如:“00:15:81:DF:F4:5B”。
  602. ///
  603. /// @return
  604. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  605. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  606. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  607. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  608. ////////////////////////////////////////////////////////////////////////////////////////////////////
  609. int POSSDKCALL_MODE OpenBlueToothPort(DEVICEHANDLE hDev, char *szMACAddress);
  610. ////////////////////////////////////////////////////////////////////////////////////////////////////
  611. /// @~English
  612. /// @brief Opens blue tooth MFI port device(by MAC address)
  613. ///
  614. /// @param [in] hDev Device handle.
  615. /// @param [in] szMACAddress Device MAC address.
  616. ///
  617. /// @return
  618. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  619. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  620. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  621. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  622. ///
  623. /// @~Chinese
  624. ///
  625. /// @brief 打开蓝牙设备(通过MAC地址)
  626. ///
  627. /// @param [in] hDev 设备句柄。
  628. /// @param [in] szMACAddress 设备MAC地址。
  629. ///
  630. /// @return
  631. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  632. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  633. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  634. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  635. ////////////////////////////////////////////////////////////////////////////////////////////////////
  636. int POSSDKCALL_MODE OpenBlueToothPortMFI(DEVICEHANDLE hDev, char *szMACAddress);
  637. ////////////////////////////////////////////////////////////////////////////////////////////////////
  638. /// @~English
  639. /// @brief Opens printer driver port
  640. ///
  641. /// @param [in] hDev Device handle.
  642. /// @param [in] szName The name of the installed printer name, it same as the device and printer in the control panel,such as:"BTP-S80(U)1".
  643. ///
  644. /// @return
  645. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  646. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  647. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  648. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  649. ///
  650. /// @~Chinese
  651. ///
  652. /// @brief 打开打印机驱动端口
  653. ///
  654. /// @param [in] hDev 设备句柄。
  655. /// @param [in] szName 已经安装的打印机驱动名称,与控制面板中的设备和打印机名称一致,例如:"BTP-S80(U)1"。
  656. ///
  657. /// @return
  658. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  659. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  660. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  661. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  662. ////////////////////////////////////////////////////////////////////////////////////////////////////
  663. int POSSDKCALL_MODE OpenDriverPort(DEVICEHANDLE hDev, char *szName);
  664. ////////////////////////////////////////////////////////////////////////////////////////////////////
  665. /// @~English
  666. /// @brief Closes open ports
  667. ///
  668. /// @param [in] hDev Device handle.
  669. ///
  670. /// @return
  671. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  672. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  673. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  674. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  675. ///
  676. /// @~Chinese
  677. ///
  678. /// @brief 关闭已打开的端口
  679. ///
  680. /// @param [in] hDev 设备句柄。
  681. ///
  682. /// @return
  683. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  684. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  685. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  686. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  687. ////////////////////////////////////////////////////////////////////////////////////////////////////
  688. int POSSDKCALL_MODE ClosePort(DEVICEHANDLE hDev);
  689. ////////////////////////////////////////////////////////////////////////////////////////////////////
  690. /// @~English
  691. /// @brief Sends a port data
  692. ///
  693. /// @param [in] hDev Port handle.
  694. /// @param [in] szData Data buffer to be sent.
  695. /// @param [in] nDataLength The number of bytes of data to be sent.
  696. /// @param [out] npReturnLen The number of bytes actually sent.
  697. ///
  698. /// @return
  699. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  700. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  701. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  702. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  703. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  704. ///
  705. /// @~Chinese
  706. ///
  707. /// @brief 发送数据
  708. ///
  709. /// @param [in] hDev 端口句柄。
  710. /// @param [in] szData 将要发送的数据缓冲区。
  711. /// @param [in] nDataLength 将要发送的数据的字节数。
  712. /// @param [out] npReturnLen 实际下发的字节数。
  713. ///
  714. /// @return
  715. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  716. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  717. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  718. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  719. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  720. ////////////////////////////////////////////////////////////////////////////////////////////////////
  721. int POSSDKCALL_MODE SendPortData(DEVICEHANDLE hDev, char *szData, int nDataLength, int *npReturnLen);
  722. ////////////////////////////////////////////////////////////////////////////////////////////////////
  723. /// @~English
  724. /// @brief Reads data from the device to the specified buffer
  725. ///
  726. /// @param [in] hDev Port handle.
  727. /// @param [in] szData Data buffer to be read.
  728. /// @param [in] nDataLength The number of bytes of data to be read.
  729. /// @param [in] npReturnLen The number of bytes actually read.
  730. ///
  731. /// <b>Remark\n</b>
  732. /// 1.The number of bytes read by the USB port must be greater than the number of bytes actually read.\n
  733. /// 2.Driver port does not support this feature.\n
  734. /// 3.In the case of reading windows serial port contents, nDataLength can not larger than the data length in the serial port buffer,set nDataLength to 0 to read out all the data in the serial port buffer.\n
  735. ///
  736. /// @return
  737. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  738. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  739. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  740. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  741. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  742. ///
  743. /// @~Chinese
  744. /// @brief 从设备读取数据到指定的缓冲区
  745. ///
  746. /// @param [in] hDev 端口句柄。
  747. /// @param [in] szData 将要读取的数据缓冲区。
  748. /// @param [in] nDataLength 将要读取的数据的字节数。
  749. /// @param [in] npReturnLen 实际读取的数据的字节数。
  750. ///
  751. /// <b>备注\n</b>
  752. /// 1、USB口的读取字节数必须大于实际读取的字节数。\n
  753. /// 2、驱动接口不支持此功能。\n
  754. /// 3、读取Winodws串口内容的情况下,参数nDataLength不能大于串口缓冲区内数据长度,将nDataLength设为0可以把串口缓冲区内所有数据读出。\n
  755. ///
  756. /// @return
  757. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  758. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  759. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  760. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  761. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  762. ////////////////////////////////////////////////////////////////////////////////////////////////////
  763. int POSSDKCALL_MODE ReadPortData(DEVICEHANDLE hDev, char *szData, int nDataLength, int *npReturnLen);
  764. ////////////////////////////////////////////////////////////////////////////////////////////////////
  765. /// @~English
  766. /// @brief Sets read and write timeout
  767. ///
  768. /// @param [in] hDev Device handle.
  769. /// @param [in] nWriteTimeout The write timeout, unit:ms, default setting:5000ms.
  770. /// @param [in] nReadTimeout The read timeout, unit:ms, default setting:3000ms.
  771. ///
  772. /// <b>Remark\n</b>
  773. /// 1.Driver port does not support this feature.\n
  774. /// 2.The default parameter is -1, set the last read or write data timeout.\n
  775. ///
  776. /// @return
  777. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  778. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  779. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  780. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  781. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  782. /// ::ERR_NOT_SUPPORT --@copybrief ::ERR_NOT_SUPPORT \n
  783. ///
  784. /// @~Chinese
  785. ///
  786. /// @brief 设置读写超时时间
  787. ///
  788. /// @param [in] hDev 设备句柄。
  789. /// @param [in] nWriteTimeout 读数据的超时时间,单位:ms,默认设置为5000ms。
  790. /// @param [in] nReadTimeout 写数据的超时时间,单位:ms,默认设置为3000ms。
  791. ///
  792. /// <b>备注\n</b>
  793. /// 1、驱动接口不支持此功能。\n
  794. /// 2、缺省参数-1,设置上一次的读或写数据超时时间。\n
  795. ///
  796. /// @return
  797. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  798. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  799. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  800. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  801. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  802. /// ::ERR_NOT_SUPPORT --@copybrief ::ERR_NOT_SUPPORT \n
  803. ////////////////////////////////////////////////////////////////////////////////////////////////////
  804. int POSSDKCALL_MODE SetPortTimeout(DEVICEHANDLE hDev, int nWriteTimeout, int nReadTimeout);
  805. ////////////////////////////////////////////////////////////////////////////////////////////////////
  806. /// @~English
  807. /// @brief Gets the read and write timeout
  808. ///
  809. /// @param [in] hDev Device handle.
  810. /// @param [out] nWriteTimeout Write data timeout,Unit: ms.
  811. /// @param [out] nReadTimeout Read data timeout,Unit: ms.
  812. ///
  813. /// @return A POSSDKCALL_MODE.
  814. ///
  815. /// <b>Remark\n</b>
  816. /// 1.The driver interface does not support this function.\n
  817. ///
  818. /// @return
  819. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  820. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  821. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  822. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  823. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  824. /// ::ERR_NOT_SUPPORT --@copybrief ::ERR_NOT_SUPPORT \n
  825. ///
  826. /// @~Chinese
  827. ///
  828. /// @brief 获取读写超时时间
  829. ///
  830. /// @param [in] hDev 设备句柄。
  831. /// @param [out] nWriteTimeout 写数据的超时时间,单位:ms。
  832. /// @param [out] nReadTimeout 读数据的超时时间,单位:ms。
  833. ///
  834. /// <b>备注\n</b>
  835. /// 1、驱动接口不支持此功能。\n
  836. ///
  837. /// @return
  838. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  839. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  840. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  841. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  842. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  843. /// ::ERR_NOT_SUPPORT --@copybrief ::ERR_NOT_SUPPORT \n
  844. ////////////////////////////////////////////////////////////////////////////////////////////////////
  845. int POSSDKCALL_MODE GetPortTimeout(DEVICEHANDLE hDev, int *nWriteTimeout, int *nReadTimeout);
  846. // 位图
  847. //
  848. ////////////////////////////////////////////////////////////////////////////////////////////////////
  849. /// @~English
  850. /// @brief Print bitmap
  851. /// @param [in] hDev Device handle.
  852. /// @param [in] szFilePath Points to a null string representing the image path and its file name, or to standard bitmap data. This image only supports 1-bit / 8-bit / 24-bit images.
  853. /// @param [in] nStartX The distance (point/mm) from the left edge of the starting point in the X (horizontal) direction of the specified area. \n effective range is 0-65535 points.
  854. /// @param [in] nStartY Specifies the distance (point/mm) from the starting point in the Y direction (vertical) to the upper boundary. \n effective range is -1-65535 points. \n this parameter only takes effect when printed in page mode, fixed as "-1" when printed in standard mode (line mode).
  855. /// @param [in] nType Printed bitmap effect.
  856. /// Valid values | Meaning
  857. /// -------|---------------------------
  858. /// 0 | Grayscale printing (clearest, but with large data volume and slow printing)
  859. /// 1 | Dither printing (relatively clear, recommended)
  860. /// 2 | Briary printing (the effect is poorer,Monochrome image are recommended) \n
  861. ///
  862. /// <b>The sample code\n</b>
  863. /// See details @ref EG_PrintBitmapExample
  864. ///
  865. /// <b>Remark\n</b>
  866. /// 1.IMPACT class printers do not support nType 0 or 2.\n
  867. /// 2.When nType is equal to 1, only partial POS printers that support grayscale printing instructions are supported.\n
  868. /// 3.Linux only supports JPG, PNG, BMP images.
  869. /// @return
  870. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  871. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  872. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  873. /// ::ERR_FILE -- @copybrief ::ERR_FILE \n
  874. /// ::ERR_BITMAP_INVAILD -- @copybrief ::ERR_BITMAP_INVAILD \n
  875. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  876. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  877. ///
  878. /// @~Chinese
  879. /// @brief 打印位图
  880. /// @param [in] hDev 设备句柄。
  881. /// @param [in] szFilePath 指向以 null 结尾的表示图片路径及其文件名的字符串或标准的位图数据。该图片只支持1位/8位/24位图片。
  882. /// @param [in] nStartX 指定区域的 X (水平)方向的起始点位置离左边界的距离(点/毫米)。\n 有效范围为 0 - 65535点。
  883. /// @param [in] nStartY 指定 Y 方向(垂直)的起始点位置离上边界的距离(点/毫米)。\n 有效范围为-1 - 65535点。\n 该参数只有在页模式打印时生效,标准模式(行模式)打印时,固定为"-1"。
  884. /// @param [in] nType 打印的位图效果。
  885. /// 有效值 | 含义
  886. /// -------|---------------------------
  887. /// 0 | 灰度打印(最清晰,但数据量大,打印慢)
  888. /// 1 | 抖动打印(比较清晰,建议使用)
  889. /// 2 | 二值化打印(效果较差,建议单色图片打印使用) \n
  890. ///
  891. /// <b>示例代码\n</b>
  892. /// 详见 @ref EG_PrintBitmapExample
  893. ///
  894. /// <b>备注\n</b>
  895. /// 1、此功能IMPACT类打印机不支持nType等于0或2。\n
  896. /// 2、此功能nType等于1时,仅部分支持灰度打印指令的POS类打印机支持。\n
  897. /// 3、Linux仅支持JPG、PNG、BMP格式图片。
  898. /// @return
  899. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  900. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  901. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  902. /// ::ERR_FILE -- @copybrief ::ERR_FILE \n
  903. /// ::ERR_BITMAP_INVAILD -- @copybrief ::ERR_BITMAP_INVAILD \n
  904. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  905. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  906. ////////////////////////////////////////////////////////////////////////////////////////////////////
  907. int POSSDKCALL_MODE PrintBitmap(DEVICEHANDLE hDev, char *szFilePath, int nStartX, int nStartY, int nType);
  908. ////////////////////////////////////////////////////////////////////////////////////////////////////
  909. /// @~English
  910. ///
  911. /// @brief Print monochrome bitmap (support for enlargement)
  912. ///
  913. /// @param [in] hDev Device handle.
  914. /// @param [in] szFilePath Points to a null-terminated string representing the image path and its file name, or to standard 1-bit bitmap data. This image only supports 1 bit depth images.
  915. /// @param [in] nStartX The distance (point/mm) from the left edge of the starting point in the X (horizontal) direction of the specified area. \n effective range is 0-65535 points
  916. /// @param [in] nStartY Specifies the distance (point/mm) from the starting point in the Y direction (vertical) to the upper boundary. \n effective range is -1-65535 points. \n this parameter only takes effect when printed in page mode, fixed as "-1" when printed in standard mode (line mode).
  917. /// @param [in] nMode Print mode for bitmaps.
  918. /// Valid values|Meaning
  919. /// -----------|-------------
  920. /// 0 | 8 point single density
  921. /// 1 | 8 point double density
  922. /// 2 | 24 point sigle density
  923. /// 3 | 24 point sigle density
  924. ///
  925. /// <b>The sample code\n</b>
  926. /// See details @ref EG_PrintBitmapExample
  927. ///
  928. /// <b>Remark\n</b>
  929. /// 1.IMPACT printers do not support nMode equals 2 or 3.\n.
  930. /// 2.Linux only supports JPG, PNG, BMP images.
  931. /// @return
  932. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  933. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  934. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  935. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  936. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  937. /// ::ERR_FILE -- @copybrief ::ERR_FILE \n
  938. /// ::ERR_BITMAP_INVAILD -- @copybrief ::ERR_BITMAP_INVAILD \n
  939. ///
  940. /// @~Chinese
  941. ///
  942. /// @brief 打印单色位图(支持放大)
  943. ///
  944. /// @param [in] hDev 设备句柄。
  945. /// @param [in] szFilePath 指向以 null 结尾的表示图片路径及其文件名的字符串或标准的1位位图数据。该图片只支持1位深度图片。
  946. /// @param [in] nStartX 指定区域的 X (水平)方向的起始点位置离左边界的距离(点/毫米)。\n 有效范围为 0 - 65535点。
  947. /// @param [in] nStartY 指定 Y 方向(垂直)的起始点位置离上边界的距离(点/毫米)。\n 有效范围为-1 - 65535点。\n 该参数只有在页模式打印时生效,标准模式(行模式)打印时,固定为"-1"。
  948. /// @param [in] nMode 位图的打印模式。
  949. /// 有效值 | 含义
  950. /// -----------|-------------
  951. /// 0 | 8点单密度
  952. /// 1 | 8点双密度
  953. /// 2 | 24点单密度
  954. /// 3 | 24点双密度
  955. ///
  956. /// <b>示例代码\n</b>
  957. /// 详见 @ref EG_PrintBitmapExample
  958. ///
  959. /// <b>备注\n</b>
  960. /// 1、此功能IMPACT类打印机不支持nMode等于2或3。\n
  961. /// 2、Linux仅支持JPG、PNG、BMP格式图片。
  962. /// @return
  963. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  964. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  965. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  966. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  967. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  968. /// ::ERR_FILE -- @copybrief ::ERR_FILE \n
  969. /// ::ERR_BITMAP_INVAILD -- @copybrief ::ERR_BITMAP_INVAILD \n
  970. ////////////////////////////////////////////////////////////////////////////////////////////////////
  971. int POSSDKCALL_MODE PrintBitmapByMode(DEVICEHANDLE hDev, char *szFilePath, int nStartX, int nStartY, int nMode);
  972. ////////////////////////////////////////////////////////////////////////////////////////////////////
  973. /// @~English
  974. /// @brief Print TrueType fonts
  975. ///
  976. /// @param [in] hDev Device handle.
  977. /// @param [in] szText Null-terminated string buffers.
  978. /// @param [in] nStartX The distance (point/mm) from the left edge of the starting point in the X (horizontal) direction of the specified area. \n effective range is 0-65535 points.
  979. /// @param [in] nStartY Specifies the distance (dot/mm) from the starting point in the Y direction (vertical) to the upper boundary. \n effective range is -1-65535 points. \n this parameter only takes effect when printed in page mode, fixed as "-1" when printed in standard mode (line mode).
  980. /// @param [in] szFontName Font name, and valid values are Windows system fonts, such as "song type", "Calibri".
  981. /// @param [in] nFontHeight Font height, effective range is greater than 0, please choose the appropriate font size.
  982. /// @param [in] nFontWidth Font width, effective range is greater than 0, please choose the appropriate font size.
  983. /// @param [in] nBold Bold, 0: no bold; 1: bold.
  984. ///
  985. /// <b>The sample code\n</b>
  986. /// See details @ref EG_PrintTextExample
  987. ///
  988. /// <b>Remark\n</b>
  989. /// 1.This function is not supported by IMPACT printers.
  990. /// @return
  991. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  992. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  993. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  994. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  995. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  996. /// ::ERR_FILE -- @copybrief ::ERR_FILE \n
  997. ///
  998. /// @~Chinese
  999. /// @brief 打印TrueType字体
  1000. ///
  1001. /// @param [in] hDev 设备句柄。
  1002. /// @param [in] szText 以 null 结尾的字符串缓冲区。
  1003. /// @param [in] nStartX 指定区域的 X (水平)方向的起始点位置离左边界的距离(点/毫米)。\n 有效范围为 0 - 65535点。
  1004. /// @param [in] nStartY 指定 Y 方向(垂直)的起始点位置离上边界的距离(点/毫米)。\n 有效范围为-1 - 65535点。\n 该参数只有在页模式打印时生效,标准模式(行模式)打印时,固定为"-1"。
  1005. /// @param [in] szFontName 字体名称,有效值为Windows系统字体,如"宋体"、"Calibri"。
  1006. /// @param [in] nFontHeight 字体高度,有效范围为大于0,请根据具体字体选择适合的字号。
  1007. /// @param [in] nFontWidth 字体宽度,有效范围为大于0,请根据具体字体选择适合的字号。
  1008. /// @param [in] nBold 加粗,0:不加粗;1:加粗。
  1009. ///
  1010. /// <b>示例代码\n</b>
  1011. /// 详见 @ref EG_PrintTextExample
  1012. ///
  1013. /// <b>备注\n</b>
  1014. /// 1、此功能IMPACT类打印机不支持。
  1015. /// 2、iOS系统下,nFontWidth参数实际意义为字体大小,nFontHeight参数无实际意义,nBold参数无实际意义,字体名称对应有是否加粗。
  1016. /// @return
  1017. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1018. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1019. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1020. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1021. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1022. /// ::ERR_FILE -- @copybrief ::ERR_FILE \n
  1023. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1024. int POSSDKCALL_MODE PrintTrueType(DEVICEHANDLE hDev, char *szText, int nStartX, int nStartY, char *szFontName, int nFontHeight, int nFontWidth, int nBold);
  1025. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1026. /// @~English
  1027. /// @brief Predownload a bitmap to the RAM of the printer and specify the ID number of the bitmap
  1028. ///
  1029. /// @param [in] hDev Device handle.
  1030. /// @param [in] szFilePath Points to a null string representing the image path and its file name, or to standard bitmap data.
  1031. /// @param [in] nImageID Specifies the ID number of the bitmap to be downloaded. Valid values are 0-7.
  1032. ///
  1033. /// <b>The sample code\n</b>
  1034. /// See details @ref EG_RAMExample
  1035. ///
  1036. /// <b>Remark\n</b>
  1037. /// 1.The bitmap size to be downloaded should not exceed 900 square millimeters (approximately 240 dots by 240 dots).\n
  1038. /// 2.Bitmaps must be monochrome.\n
  1039. /// 3.The available RAM space inside a typical printer is 8K bytes.\n
  1040. /// 4.Bitmap ID number does not require consistent.\n
  1041. /// 5.Bitmaps downloaded into RAM will not be saved after power off.\n
  1042. /// 6.This function, IMPACT printer, is not supported.\n
  1043. /// 7.Linux only supports JPG, PNG, BMP images.\n
  1044. /// 8.Non-monochrome images will be dithered and downloaded.\n
  1045. /// 9.This image only supports 1-bit / 8-bit / 24-bit images.
  1046. /// @return
  1047. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1048. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1049. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1050. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1051. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1052. /// ::ERR_FILE -- @copybrief ::ERR_FILE \n
  1053. /// ::ERR_BITMAP_INVAILD -- @copybrief ::ERR_BITMAP_INVAILD \n
  1054. ///
  1055. /// @~Chinese
  1056. /// @brief 预下载一幅位图到打印机的 RAM 中,同时指定此位图的 ID 号
  1057. ///
  1058. /// @param [in] hDev 设备句柄。
  1059. /// @param [in] szFilePath 指向以 null 结尾的表示图片路径及其文件名的字符串或标准的位图数据。
  1060. /// @param [in] nImageID 指定将要下载的位图的 ID 号。有效值为0 - 7。
  1061. ///
  1062. /// <b>示例代码\n</b>
  1063. /// 详见 @ref EG_RAMExample
  1064. ///
  1065. /// <b>备注\n</b>
  1066. /// 1、将要下载的位图大小不能超过 900 平方毫米 (大约为 240点 × 240 点)。\n
  1067. /// 2、位图必须是单色的。\n
  1068. /// 3、一般打印机内部的可用 RAM 空间为 8K 字节。\n
  1069. /// 4、位图的 ID 号不要求是连续的。\n
  1070. /// 5、下载到RAM中的位图在打印机关电后不被保存。\n
  1071. /// 6、此功能IMPACT类打印机不支持。\n
  1072. /// 7、Linux仅支持JPG、PNG、BMP格式图片。\n
  1073. /// 8、非单色位图会进行抖动处理后下载。\n
  1074. /// 9、仅支持1位/8位/24位深图片。
  1075. /// @return
  1076. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1077. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1078. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1079. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1080. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1081. /// ::ERR_FILE -- @copybrief ::ERR_FILE \n
  1082. /// ::ERR_BITMAP_INVAILD -- @copybrief ::ERR_BITMAP_INVAILD \n
  1083. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1084. int POSSDKCALL_MODE DownloadRAMBitmapByFile(DEVICEHANDLE hDev, char *szFilePath, int nImageID);
  1085. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1086. /// @~English
  1087. /// @brief Print the bitmap that has been downloaded to RAM
  1088. ///
  1089. /// @param [in] hDev Device handle.
  1090. /// @param [in] nImageID The ID number of the bitmap downloaded. Valid values are 0-7.
  1091. /// @param [in] nStartX The distance (dot/mm) from the left edge of the starting point in the X (horizontal) direction of the specified area. \n effective range is 0-65535 points.
  1092. /// @param [in] nStartY Specifies the distance (dot/mm) from the starting point in the Y direction (vertical) to the upper boundary. \n effective range is -1-65535 points. \n this parameter only takes effect when printed in page mode, fixed as "-1" when printed in standard mode (line mode).
  1093. /// @param [in] nMode Specifies the print mode for the bitmap. Can be one of the values listed in the following list:
  1094. /// Valid values | Meaning
  1095. /// ---------|----------------
  1096. /// 0 | Normal
  1097. /// 1 | Times as wide
  1098. /// 2 | Times as high
  1099. /// 3 | Times as wide and times as high
  1100. ///
  1101. /// <b>The sample code\n</b>
  1102. /// See details @ref EG_RAMExample
  1103. ///
  1104. /// <b>Remark\n</b>
  1105. /// 1.This function is not supported by IMPACT printers.
  1106. /// @return
  1107. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1108. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1109. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1110. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1111. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1112. ///
  1113. /// @~Chinese
  1114. /// @brief 打印已经下载到 RAM 中的位图
  1115. ///
  1116. /// @param [in] hDev 设备句柄。
  1117. /// @param [in] nImageID 下载的位图的 ID 号。有效值为0 - 7。
  1118. /// @param [in] nStartX 指定区域的 X (水平)方向的起始点位置离左边界的距离(点/毫米)。\n 有效范围为 0 - 65535点。
  1119. /// @param [in] nStartY 指定 Y 方向(垂直)的起始点位置离上边界的距离(点/毫米)。\n 有效范围为-1 - 65535点。\n 该参数只有在页模式打印时生效,标准模式(行模式)打印时,固定为"-1"。
  1120. /// @param [in] nMode 指定位图的打印模式。可以为以下列表中所列值之一:
  1121. /// 有效值 | 含义
  1122. /// ---------|----------------
  1123. /// 0 | 正常
  1124. /// 1 | 倍宽
  1125. /// 2 | 倍高
  1126. /// 3 | 倍宽且倍高
  1127. ///
  1128. /// <b>示例代码\n</b>
  1129. /// 详见 @ref EG_RAMExample
  1130. ///
  1131. /// <b>备注\n</b>
  1132. /// 1、此功能IMPACT类打印机不支持。
  1133. /// @return
  1134. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1135. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1136. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1137. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1138. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1139. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1140. int POSSDKCALL_MODE PrintRAMBitmap(DEVICEHANDLE hDev, int nImageID, int nStartX, int nStartY, int nMode);
  1141. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1142. /// @~English
  1143. /// @brief Predownload one or more bitmaps to the printer's Flash
  1144. ///
  1145. /// @param [in] hDev Device handle.
  1146. /// @param [in] szFilePath Points to an array of strings containing file paths and their names for several bitmaps.
  1147. /// @param [in] nImageID Specifies the number of bitmaps to be downloaded. The valid range is 1-255.
  1148. ///
  1149. /// <b>The sample code\n</b>
  1150. /// See details @ref EG_FlashExample
  1151. ///
  1152. /// <b>Remark\n</b>
  1153. /// 1.The data size of each bitmap cannot exceed 8K bytes (approximately 256 x 256 points).\n
  1154. /// 2.Non-monochrome images will be dithered and downloaded.\n
  1155. /// 3.The number of images downloaded into Flash is related to the number and order of bitmaps. Bitmaps are downloaded in the same order as file names in the array, and are sequential. For example, the first bitmap number is 1, the second bitmap number is 2, and so on.\n
  1156. /// 4.Each download will clear the bitmap from the last download to Flash.\n
  1157. /// 5.It will not be cleaned when the power is turned off.\n
  1158. /// 6.The amount of Flash available inside a printer depends on the type of printer.\n
  1159. /// 7.The bitmaps downloaded into FLASH are saved after the printer turns off the power.\n
  1160. /// 8.Linux only supports JPG, PNG, BMP images.\n
  1161. /// 9.This image only supports 1-bit / 8-bit / 24-bit images.
  1162. /// @return
  1163. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1164. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1165. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1166. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1167. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1168. /// ::ERR_FILE -- @copybrief ::ERR_FILE \n
  1169. /// ::ERR_BITMAP_INVAILD -- @copybrief ::ERR_BITMAP_INVAILD \n
  1170. ///
  1171. /// @~Chinese
  1172. /// @brief 预下载一幅或若干幅位图到打印机的 Flash 中
  1173. ///
  1174. /// @param [in] hDev 设备句柄。
  1175. /// @param [in] szFilePath 指向包含若干位图的文件路径及其名称的字符串数组。
  1176. /// @param [in] nImageCount 指定将要下载的位图幅数。有效范围为1-255。
  1177. ///
  1178. /// <b>示例代码\n</b>
  1179. /// 详见 @ref EG_FlashExample
  1180. ///
  1181. /// <b>备注\n</b>
  1182. /// 1、每幅位图的数据大小不能超过 8K 字节(大约为 256 点 × 256 点)。\n
  1183. /// 2、非单色位图会进行抖动处理后下载。\n
  1184. /// 3、下载到 Flash 中的图片的图号与位图的个数和排列顺序相关。位图的下载顺序和文件名在数组中的顺序一致,是连续的。如:第一个位图的图号为 1,第二个为 2,以此类推。\n
  1185. /// 4、每次下载都会把上次下载到 Flash 中的位图都清除。\n
  1186. /// 5、关电后不会被清除。\n
  1187. /// 6、打印机内部Flash 的可使用空间与具体打印机型号有关。\n
  1188. /// 7、下载到FLASH中的位图在打印机关电后仍然被保存。\n
  1189. /// 8、Linux仅支持JPG、PNG、BMP格式图片。\n
  1190. /// 9、仅支持1位/8位/24位深图片。
  1191. /// @return
  1192. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1193. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1194. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1195. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1196. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1197. /// ::ERR_FILE -- @copybrief ::ERR_FILE \n
  1198. /// ::ERR_BITMAP_INVAILD -- @copybrief ::ERR_BITMAP_INVAILD \n
  1199. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1200. int POSSDKCALL_MODE DownloadFlashBitmapByFile(DEVICEHANDLE hDev, char *szFilePath[], int nImageCount);
  1201. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1202. /// @~English
  1203. /// @brief Print the bitmap that has been downloaded into Flash
  1204. ///
  1205. /// @param [in] hDev Device handle.
  1206. /// @param [in] nImageID Specifies the bitmap ID number. The valid range is 1-255.
  1207. /// @param [in] nStartX The distance (dot/mm) from the left edge of the starting point in the X (horizontal) direction of the specified area. \n effective range is 0-65535 points.
  1208. /// @param [in] nStartY Specifies the distance (dot/mm) from the starting point in the Y direction (vertical) to the upper boundary. \n effective range is -1-65535 points. \n this parameter only takes effect when printed in page mode, fixed as "-1" when printed in standard mode (line mode).
  1209. /// @param [in] nMode Specifies the print mode for the bitmap. Can be one of the values listed in the following list:
  1210. /// Valid values | Meaning
  1211. /// ---------|----------------
  1212. /// 0 | Normal
  1213. /// 1 | Times as wide
  1214. /// 2 | Times as high
  1215. /// 3 | Times as wide and times as high
  1216. ///
  1217. /// <b>The sample code\n</b>
  1218. /// See details @ref EG_FlashExample
  1219. ///
  1220. /// @return
  1221. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1222. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1223. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1224. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1225. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1226. ///
  1227. /// @~Chinese
  1228. /// @brief 打印已经下载到 Flash 中的位图
  1229. ///
  1230. /// @param [in] hDev 设备端口。
  1231. /// @param [in] nImageID 指定位图ID号。有效范围为1-255。
  1232. /// @param [in] nStartX 指定区域的 X (水平)方向的起始点位置离左边界的距离(点/毫米)。\n 有效范围为 0 - 65535点。
  1233. /// @param [in] nStartY 指定 Y 方向(垂直)的起始点位置离上边界的距离(点/毫米)。\n 有效范围为-1 - 65535点。\n 该参数只有在页模式打印时生效,标准模式(行模式)打印时,固定为"-1"。
  1234. /// @param [in] nMode 指定位图的打印模式。可以为以下列表中所列值之一:
  1235. /// 有效值 | 含义
  1236. /// ---------|----------------
  1237. /// 0 | 正常
  1238. /// 1 | 倍宽
  1239. /// 2 | 倍高
  1240. /// 3 | 倍宽且倍高
  1241. ///
  1242. /// <b>示例代码\n</b>
  1243. /// 详见 @ref EG_FlashExample
  1244. ///
  1245. /// @return
  1246. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1247. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1248. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1249. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1250. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1251. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1252. int POSSDKCALL_MODE PrintFlashBitmap(DEVICEHANDLE hDev, int nImageID, int nStartX, int nStartY, int nMode);
  1253. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1254. /// @~English
  1255. ///
  1256. /// @brief Set and print barcode
  1257. ///
  1258. /// @param [in] hDev Device handle.
  1259. /// @param [in] szDataBuffer Points to a null-terminated string. The range and format allowed per character depends on the specific barcode type.
  1260. /// @param [in] nStartX The distance (dot/mm) from the left edge of the starting point in the X (horizontal) direction of the specified area. \n effective range is 0-65535 points.
  1261. /// @param [in] nStartY Specifies the distance (dot/mm) from the starting point in the Y direction (vertical) to the upper boundary. \n effective range is -1-65535 points. \n this parameter only takes effect when printed in page mode, fixed as "-1" when printed in standard mode (line mode).
  1262. /// @param [in] nType Specifies the type of barcode. Can be one of the values listed in the following list:
  1263. /// Valid values | Meaning
  1264. /// ---------|----------------
  1265. /// 65 | UPC-A
  1266. /// 66 | UPC-C
  1267. /// 67 | JAN13(EAN13)
  1268. /// 68 | JAN8(EAN8)
  1269. /// 69 | CODE39
  1270. /// 70 | INTERLEAVED 2 OF 5
  1271. /// 71 | CODEBAR
  1272. /// 72 | CODE 93
  1273. /// 73 | CODE 128
  1274. /// @param [in] nBasicWidth Specifies the number of base element widths of the bar code. \n ranges from 1 to 6 points.
  1275. /// @param [in] nHeight Specifies the height of the bar code (dot/mm). \n valid range is 1-255 points.
  1276. /// @param [in] nHriFontType Specify the type of font for HRI (Human Readable Interpretation) characters. Can be one of the following values:
  1277. /// Valid values | Meaning
  1278. /// ---------|----------------
  1279. /// 0 | Standard ASCII
  1280. /// 1 | Compression ASCII
  1281. /// @param [in] nHriFontPosition Specify the location of the HRI (Human Readable Interpretation) characters. Can be one of the following values:
  1282. /// Valid values | Meaning
  1283. /// ---------|----------------
  1284. /// 0 | Don't print
  1285. /// 1 | Print above barcode only
  1286. /// 2 | Print below the barcode only
  1287. /// 3 | Print above and below the barcode
  1288. /// @param [in] nBytesToPrint Total number of characters sent to the printer. No more than the length of szDataBuffer valid data.
  1289. ///
  1290. /// <b>The sample code\n</b>
  1291. /// See details @ref EG_PrintBarcodeExample
  1292. ///
  1293. /// <b> Remark\n </b>
  1294. /// 1.In page mode, this function does not print the barcode immediately, until the call function ::PageModePrint.
  1295. /// @return
  1296. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1297. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1298. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1299. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1300. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1301. ///
  1302. /// @~Chinese
  1303. ///
  1304. /// @brief 设置并打印条码
  1305. ///
  1306. /// @param [in] hDev 设备句柄。
  1307. /// @param [in] szDataBuffer 指向以 null 结尾的字符串。每个字符允许的范围和格式与具体条码类型有关。
  1308. /// @param [in] nStartX 指定区域的 X (水平)方向的起始点位置离左边界的距离(点/毫米)。\n 有效范围为 0 - 65535点。
  1309. /// @param [in] nStartY 指定 Y 方向(垂直)的起始点位置离上边界的距离(点/毫米)。\n 有效范围为-1 - 65535点。\n 该参数只有在页模式打印时生效,标准模式(行模式)打印时,固定为"-1"。
  1310. /// @param [in] nType 指定条码的类型。可以为以下列表中所列值之一:
  1311. /// 有效值 | 含义
  1312. /// ---------|----------------
  1313. /// 65 | UPC-A
  1314. /// 66 | UPC-C
  1315. /// 67 | JAN13(EAN13)
  1316. /// 68 | JAN8(EAN8)
  1317. /// 69 | CODE39
  1318. /// 70 | INTERLEAVED 2 OF 5
  1319. /// 71 | CODEBAR
  1320. /// 72 | CODE 93
  1321. /// 73 | CODE 128
  1322. /// @param [in] nBasicWidth 指定条码的基本元素宽度点数。\n取值范围 1 - 6 点。
  1323. /// @param [in] nHeight 指定条码的高度(点/毫米)。\n 有效范围为 1 - 255 点。
  1324. /// @param [in] nHriFontType 指定 HRI(Human Readable Interpretation)字符的字体类型。可以为以下值之一:
  1325. /// 有效值 | 含义
  1326. /// ---------|----------------
  1327. /// 0 | 标准ASCII
  1328. /// 1 | 压缩ASCII
  1329. /// @param [in] nHriFontPosition 指定HRI(Human Readable Interpretation)字符的位置。可以为以下值之一:
  1330. /// 有效值 | 含义
  1331. /// ---------|----------------
  1332. /// 0 | 不打印
  1333. /// 1 | 只在条码上方打印
  1334. /// 2 | 只在条码下方打印
  1335. /// 3 | 条码上、下方都打印
  1336. /// @param [in] nBytesToPrint 指定由参数 szDataBuffer指向的字符串长度,即将要发送给打印机的字符总数,不可大于szDataBuffer有效数据长度。具体值与条码类型有关。
  1337. ///
  1338. /// <b>示例代码\n</b>
  1339. /// 详见 @ref EG_PrintBarcodeExample
  1340. ///
  1341. /// <b> 备注\n </b>
  1342. /// 1、在页模式下,此函数并不立即打印条码,而是一直到调用函数 ::PageModePrint时才打印。
  1343. /// @return
  1344. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1345. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1346. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1347. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1348. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1349. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1350. int POSSDKCALL_MODE PrintBarcode(DEVICEHANDLE hDev, char *szDataBuffer, int nStartX, int nStartY, int nType, int nBasicWidth, int nHeight, int nHriFontType, int nHriFontPosition, int nBytesToPrint);
  1351. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1352. /// @~English
  1353. /// @brief Set and print barcode (simple interface)
  1354. ///
  1355. /// @param [in] hDev Device handle.
  1356. /// @param [in] szDataBuffer Points to a null-terminated string. The range and format allowed per character depends on the specific barcode type.
  1357. /// @param [in] nStartX The distance (dot/mm) from the left edge of the starting point in the X (horizontal) direction of the specified area. \n effective range is 0-65535 points.
  1358. /// @param [in] nStartY Specifies the distance (dot/mm) from the starting point in the Y direction (vertical) to the upper boundary. \n effective range is -1-65535 points. \n this parameter only takes effect when printed in page mode, fixed as "-1" when printed in standard mode (line mode).
  1359. /// @param [in] nType Specifies the type of barcode. Can be one of the values listed in the following list:
  1360. /// Valid values | Meaning
  1361. /// ---------|----------------
  1362. /// 65 | UPC-A
  1363. /// 66 | UPC-C
  1364. /// 67 | JAN13(EAN13)
  1365. /// 68 | JAN8(EAN8)
  1366. /// 69 | CODE39
  1367. /// 70 | INTERLEAVED 2 OF 5
  1368. /// 71 | CODEBAR
  1369. /// 72 | CODE 93
  1370. /// 73 | CODE 128
  1371. /// @param [in] nWidth Specifies the width of the barcode (dot/mm).
  1372. /// @param [in] nHeight Specifies the height of the bar code (dot/mm). \n Valid range is 1-255 points.
  1373. /// @param [in] nHriFontPosition Specify the location of the HRI (Human Readable) characters. Can be one of the following values:
  1374. /// Valid values | Meaning
  1375. /// ---------|----------------
  1376. /// 0 | Don't print
  1377. /// 1 | Print above barcode only
  1378. /// 2 | Print below the barcode only
  1379. /// 3 | Print above and below the barcode
  1380. ///
  1381. /// <b>The sample code\n</b>
  1382. /// See details @ref EG_PrintBarcodeExample
  1383. ///
  1384. /// <b>Remark\n</b>
  1385. /// 1.In page mode, this function does not print the barcode immediately,until the PageModePrint function is called.
  1386. /// @return
  1387. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1388. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1389. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1390. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1391. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1392. ///
  1393. /// @~Chinese
  1394. ///
  1395. /// @brief 设置并打印条码(简易接口)
  1396. ///
  1397. /// @param [in] hDev 设备句柄。
  1398. /// @param [in] szDataBuffer 指向以 null 结尾的字符串。每个字符允许的范围和格式与具体条码类型有关。
  1399. /// @param [in] nStartX 指定区域的 X (水平)方向的起始点位置离左边界的距离(点/毫米)。\n 有效范围为 0 - 65535点。
  1400. /// @param [in] nStartY 指定 Y 方向(垂直)的起始点位置离上边界的距离(点/毫米)。\n 有效范围为-1 - 65535点。\n 该参数只有在页模式打印时生效,标准模式(行模式)打印时,固定为"-1"。
  1401. /// @param [in] nType 指定条码的类型。可以为以下列表中所列值之一:
  1402. /// 有效值 | 含义
  1403. /// ---------|----------------
  1404. /// 65 | UPC-A
  1405. /// 66 | UPC-C
  1406. /// 67 | JAN13(EAN13)
  1407. /// 68 | JAN8(EAN8)
  1408. /// 69 | CODE39
  1409. /// 70 | INTERLEAVED 2 OF 5
  1410. /// 71 | CODEBAR
  1411. /// 72 | CODE 93
  1412. /// 73 | CODE 128
  1413. /// @param [in] nWidth 指定条码的宽度(点/毫米)。
  1414. /// @param [in] nHeight 指定条码的高度(点/毫米)。\n 有效范围为 1 - 255 点。
  1415. /// @param [in] nHriFontPosition 指定HRI(Human Readable Interpretation)字符的位置。可以为以下值之一:
  1416. /// 有效值 | 含义
  1417. /// ---------|----------------
  1418. /// 0 | 不打印
  1419. /// 1 | 只在条码上方打印
  1420. /// 2 | 只在条码下方打印
  1421. /// 3 | 条码上、下方都打印
  1422. ///
  1423. /// <b>示例代码\n</b>
  1424. /// 详见 @ref EG_PrintBarcodeExample
  1425. ///
  1426. /// <b>备注\n</b>
  1427. /// 1、在页模式下,此函数并不立即打印条码,而是一直到调用函数PageModePrint时才打印。
  1428. /// @return
  1429. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1430. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1431. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1432. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1433. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1434. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1435. int POSSDKCALL_MODE PrintBarcodeSimple(DEVICEHANDLE hDev, char *szDataBuffer, int nStartX, int nStartY, int nType, int nWidth, int nHeight, int nHriFontPosition);
  1436. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1437. /// @~English
  1438. ///
  1439. /// @brief Set and print the QR code
  1440. ///
  1441. /// @param [in] hDev Devcie handle.
  1442. /// @param [in] szDataBuffer Points to a null-terminated string.
  1443. /// @param [in] nStartX The distance (dot/mm) from the left edge of the starting point in the X (horizontal) direction of the specified area. \n effective range is 0-65535 points.
  1444. /// @param [in] nStartY Specifies the distance (dot/mm) from the starting point in the Y direction (vertical) to the upper boundary. \n effective range is -1-65535 points. \n this parameter only takes effect when printed in page mode, fixed as "-1" when printed in standard mode (line mode).
  1445. /// @param [in] nBasicWidth Specifies the number of base element widths of the bar code. \n valid range is 1-10 points.
  1446. /// @param [in] nSymbolType Symbol type. The effective range of \n is 1-2. \n 1: for primitive type 2: for enhanced type (recommended).
  1447. /// @param [in] nLanguageMode The language mode.\n valid range is 0-1. \n 0: for Chinese 1: for Japanese
  1448. /// @param [in] nErrorCorrect QR code error correction level. \n valid range is 0-3. \n 0: represents L level, 1 represents M level, 2 represents Q level, 3 represents H level.
  1449. /// @param [in] nBytesToPrint Total number of characters sent to the printer. No more than the length of szDataBuffer valid data.
  1450. ///
  1451. /// <b>The sample code\n</b>
  1452. /// See details @ref EG_PrintBarcodeExample
  1453. ///
  1454. /// <b>Remark\n</b>
  1455. /// 1.In page mode, this function does not immediately print the bar code, until the call function PageModePrint to print.\n
  1456. /// 2.This feature is only supported by POS class printers.
  1457. /// 3.Please ensure that the szDataBuffer within the length of the nBytesToPrint parameter is valid data, otherwise it may cause a crash.
  1458. /// @return
  1459. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1460. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1461. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1462. /// ::ERR_NOT_SUPPORT -- @copybrief ::ERR_NOT_SUPPORT \n
  1463. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1464. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1465. ///
  1466. /// @~Chinese
  1467. ///
  1468. /// @brief 设置并打印QR码
  1469. ///
  1470. /// @param [in] hDev 设备句柄。
  1471. /// @param [in] szDataBuffer 指向以 null 结尾的字符串。
  1472. /// @param [in] nStartX 指定区域的 X (水平)方向的起始点位置离左边界的距离(点/毫米)。\n 有效范围为 0 - 65535点。
  1473. /// @param [in] nStartY 指定 Y 方向(垂直)的起始点位置离上边界的距离(点/毫米)。\n 有效范围为-1 - 65535点。\n 该参数只有在页模式打印时生效,标准模式(行模式)打印时,固定为"-1"。
  1474. /// @param [in] nBasicWidth 指定条码的基本元素宽度点数。\n 有效范围为 1 - 10 点。
  1475. /// @param [in] nSymbolType 符号类型。\n 有效范围为 1 - 2。\n 1:表示原始类型 2: 表示增强类型(推荐使用)。
  1476. /// @param [in] nLanguageMode 语言模式。\n 有效范围为 0 - 1。\n 0:表示汉字 1: 表示日文。
  1477. /// @param [in] nErrorCorrect QR码纠错等级。\n 有效范围为 0 - 3。\n 0:代表L级别 1代表M级别 2代表Q级别 3代表H级别。
  1478. /// @param [in] nBytesToPrint 指定由参数 szDataBuffer指向的字符串个数,即将要发送给打印机的字符总数。\n 有效范围为 1 - 252且不可大于szDataBuffer有效数据长度。
  1479. ///
  1480. /// <b>示例代码\n</b>
  1481. /// 详见 @ref EG_PrintBarcodeExample
  1482. ///
  1483. /// <b>备注\n</b>
  1484. /// 1、在页模式下,此函数并不立即打印条码,而是一直到调用函数PageModePrint时才打印。\n
  1485. /// 2、此功能针打类(IMPACT)打印机不支持。\n
  1486. /// 3、请确保nBytesToPrint参数长度内szDataBuffer均为有效数据,否则可能引发崩溃。
  1487. /// @return
  1488. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1489. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1490. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1491. /// ::ERR_NOT_SUPPORT -- @copybrief ::ERR_NOT_SUPPORT \n
  1492. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1493. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1494. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1495. int POSSDKCALL_MODE BarcodePrintQR(DEVICEHANDLE hDev, char *szDataBuffer, int nStartX, int nStartY, int nBasicWidth, int nSymbolType, int nLanguageMode, int nErrorCorrect, int nBytesToPrint);
  1496. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1497. /// @~English
  1498. ///
  1499. /// @brief Set and print the QR code
  1500. ///
  1501. /// @param [in] hDev Devcie handle.
  1502. /// @param [in] szDataBuffer Points to a null-terminated string.
  1503. /// @param [in] nStartX The distance (dot/mm) from the left edge of the starting point in the X (horizontal) direction of the specified area. \n effective range is 0-65535 points.
  1504. /// @param [in] nStartY Specifies the distance (dot/mm) from the starting point in the Y direction (vertical) to the upper boundary. \n effective range is -1-65535 points. \n this parameter only takes effect when printed in page mode, fixed as "-1" when printed in standard mode (line mode).
  1505. /// @param [in] nBasicWidth Specifies the number of base element widths of the bar code. \n valid range is 1-16 points.
  1506. /// @param [in] nErrorCorrect QR code error correction level. \n valid range is 0-3. \n 0: represents L level, 1 represents M level, 2 represents Q level, 3 represents H level.
  1507. /// @param [in] nBytesToPrint Total number of characters sent to the printer. No more than the length of szDataBuffer valid data.
  1508. ///
  1509. /// <b>The sample code\n</b>
  1510. /// See details @ref EG_PrintBarcodeExample
  1511. ///
  1512. /// <b>Remark\n</b>
  1513. /// 1.In page mode, this function does not immediately print the bar code, until the call function PageModePrint to print.\n
  1514. /// 2.This feature is not supported by the IMPACT class printer.\n
  1515. /// 3.Please ensure that the szDataBuffer within the length of the nBytesToPrint parameter is valid data, otherwise it may cause a crash.
  1516. /// @return
  1517. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1518. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1519. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1520. /// ::ERR_NOT_SUPPORT -- @copybrief ::ERR_NOT_SUPPORT \n
  1521. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1522. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1523. ///
  1524. /// @~Chinese
  1525. ///
  1526. /// @brief 设置并打印QR码
  1527. ///
  1528. /// @param [in] hDev 设备句柄。
  1529. /// @param [in] szDataBuffer 指向以 null 结尾的字符串。
  1530. /// @param [in] nStartX 指定区域的 X (水平)方向的起始点位置离左边界的距离(点/毫米)。\n 有效范围为 0 - 65535点。
  1531. /// @param [in] nStartY 指定 Y 方向(垂直)的起始点位置离上边界的距离(点/毫米)。\n 有效范围为-1 - 65535点。\n 该参数只有在页模式打印时生效,标准模式(行模式)打印时,固定为"-1"。
  1532. /// @param [in] nBasicWidth 指定条码的基本元素宽度点数。\n 有效范围为 1 - 16 点。
  1533. /// @param [in] nErrorCorrect QR码纠错等级。\n 有效范围为 0 - 3。\n 0:代表L级别 1代表M级别 2代表Q级别 3代表H级别。
  1534. /// @param [in] nBytesToPrint 指定由参数 szDataBuffer指向的字符串个数,即将要发送给打印机的字符总数。\n 有效范围为 1 - 7089且不可大于szDataBuffer有效数据长度。
  1535. ///
  1536. /// <b>示例代码\n</b>
  1537. /// 详见 @ref EG_PrintBarcodeExample
  1538. ///
  1539. /// <b>备注\n</b>
  1540. /// 1、在页模式下,此函数并不立即打印条码,而是一直到调用函数PageModePrint时才打印。\n
  1541. /// 2、此功能仅POS类打印机支持。\n
  1542. /// 3、请确保nBytesToPrint参数长度内szDataBuffer均为有效数据,否则可能引发崩溃。
  1543. /// @return
  1544. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1545. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1546. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1547. /// ::ERR_NOT_SUPPORT -- @copybrief ::ERR_NOT_SUPPORT \n
  1548. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1549. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1550. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1551. int POSSDKCALL_MODE BarcodePrintQREx(DEVICEHANDLE hDev, char *szDataBuffer, int nStartX, int nStartY, int nBasicWidth, int nErrorCorrect, int nBytesToPrint);
  1552. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1553. /// @~English
  1554. ///
  1555. /// @brief Set and print PDF417
  1556. ///
  1557. /// @param [in] hDev Device handle.
  1558. /// @param [in] szDataBuffer Points to a null-terminated string.
  1559. /// @param [in] nStartX The distance (dot/mm) from the left edge of the starting point in the X (horizontal) direction of the specified area. \n effective range is 0-65535 points.
  1560. /// @param [in] nStartY Specifies the distance (dot/mm) from the starting point in the Y direction (vertical) to the upper boundary. \n effective range is -1-65535 points. \n this parameter only takes effect when printed in page mode, fixed to "-1" when printed in standard mode (line mode).
  1561. /// @param [in] nBasicWidth Specifies the number of base element widths of the bar code. \n valid range is 1-7 points.
  1562. /// @param [in] nHeight Specifies the height number of bar code elements. \n effective range is 2-25 points.
  1563. /// @param [in] nLines Specifies the number of lines in the barcode. \n valid range is 3-90.
  1564. /// @param [in] nColumns Specifies the number of columns of the barcode. \n valid range is 1-30.
  1565. /// @param [in] nScaleH Specifies the bar code appearance ratio height. The effective range of \n is 1-10.
  1566. /// @param [in] nScaleV Specifies the bar code appearance ratio width. \n valid range is 1-100.
  1567. /// @param [in] nErrorCorrect Specify bar code error correction level. \n effective range is 0-8.
  1568. /// @param [in] nBytesToPrint Total number of characters sent to the printer. No more than the length of szDataBuffer valid data.
  1569. ///
  1570. /// <b>The sample code\n</b>
  1571. /// See details @ref EG_PrintBarcodeExample
  1572. ///
  1573. /// <b>Remark\n</b>
  1574. /// 1.In page mode, this function does not immediately print the bar code, until the call function PageModePrint to print.\n
  1575. /// 2.This feature is not supported by the IMPACT class printer.
  1576. /// @return
  1577. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1578. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1579. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1580. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1581. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1582. ///
  1583. /// @~Chinese
  1584. ///
  1585. /// @brief 设置并打印PDF417码
  1586. ///
  1587. /// @param [in] hDev 设备句柄。
  1588. /// @param [in] szDataBuffer 指向以 null 结尾的字符串。
  1589. /// @param [in] nStartX 指定区域的 X (水平)方向的起始点位置离左边界的距离(点/毫米)。\n 有效范围为 0 - 65535点。
  1590. /// @param [in] nStartY 指定 Y 方向(垂直)的起始点位置离上边界的距离(点/毫米)。\n 有效范围为-1 - 65535点。\n 该参数只有在页模式打印时生效,标准模式(行模式)打印时,固定为"-1"。
  1591. /// @param [in] nBasicWidth 指定条码的基本元素宽度点数。\n 有效范围为 1 - 7 点。
  1592. /// @param [in] nHeight 指定条码元素高度点数。\n 有效范围为 2 - 25 点。
  1593. /// @param [in] nLines 指定条码的行数。\n 有效范围为 3 - 90。
  1594. /// @param [in] nColumns 指定条码的列数。\n 有效范围为 1 - 30。
  1595. /// @param [in] nScaleH 指定条码外观比高度。\n 有效范围为 1 - 10。
  1596. /// @param [in] nScaleV 指定条码外观比宽度。\n 有效范围为 1 - 100。
  1597. /// @param [in] nErrorCorrect 指定条码纠错级别。\n 有效范围为 0 - 8。
  1598. /// @param [in] nBytesToPrint 指定由参数 szDataBuffer指向的字符串个数,即将要发送给打印机的字符总数,不可大于szDataBuffer有效数据长度。
  1599. ///
  1600. /// <b>示例代码\n</b>
  1601. /// 详见 @ref EG_PrintBarcodeExample
  1602. ///
  1603. /// <b>备注\n</b>
  1604. /// 1、在页模式下,此函数并不立即打印条码,而是一直到调用函数PageModePrint时才打印。\n
  1605. /// 2、此功能IMPACT类打印机不支持。
  1606. /// @return
  1607. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1608. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1609. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1610. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1611. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1612. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1613. int POSSDKCALL_MODE BarcodePrintPDF417(DEVICEHANDLE hDev, char *szDataBuffer, int nStartX, int nStartY, int nBasicWidth, int nHeight, int nLines, int nColumns, int nScaleH, int nScaleV, int nCorrectGrade, int nBytesToPrint);
  1614. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1615. /// @~English
  1616. /// @brief Set and print PDF417 (simple interface)
  1617. ///
  1618. /// @param [in] hDev Device handle.
  1619. /// @param [in] szDataBuffer Points to a null-terminated string.
  1620. /// @param [in] nStartX The distance (dot/mm) from the left edge of the starting point in the X (horizontal) direction of the specified area. \n effective range is 0-65535 points.
  1621. /// @param [in] nStartY Specifies the distance (dot/mm) from the starting point in the Y direction (vertical) to the upper boundary. \n effective range is -1-65535 points. \n this parameter only takes effect when printed in page mode, fixed to "-1" when printed in standard mode (line mode).
  1622. /// @param [in] nWidth Specifies the width of the bar code (dot/mm).
  1623. /// @param [in] nHeight Specifies height of bar code element (dot/mm). \n effective range is 2-25 points.
  1624. ///
  1625. /// <b>The sample code\n</b>
  1626. /// See details @ref EG_PrintBarcodeExample
  1627. ///
  1628. /// <b>Remark\n</b>
  1629. /// 1.In page mode, this function does not immediately print the bar code, until the call function PageModePrint to print.\n
  1630. /// 2.This feature is not supported by the IMPACT class printer.
  1631. /// @return
  1632. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1633. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1634. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1635. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1636. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1637. ///
  1638. /// @~Chinese
  1639. ///
  1640. /// @brief 设置并打印PDF417码(简易接口)
  1641. ///
  1642. /// @param [in] hDev 设备句柄。
  1643. /// @param [in] szDataBuffer 指向以 null 结尾的字符串。
  1644. /// @param [in] nStartX 指定区域的 X (水平)方向的起始点位置离左边界的距离(点/毫米)。\n 有效范围为 0 - 65535点。
  1645. /// @param [in] nStartY 指定 Y 方向(垂直)的起始点位置离上边界的距离(点/毫米)。\n 有效范围为-1 - 65535点。\n 该参数只有在页模式打印时生效,标准模式(行模式)打印时,固定为"-1"。
  1646. /// @param [in] nWidth 指定条码的宽度(点/毫米)。
  1647. /// @param [in] nHeight 指定条码元素高度(点/毫米)。\n 有效范围为 2 - 25 点。
  1648. ///
  1649. /// <b>示例代码\n</b>
  1650. /// 详见 @ref EG_PrintBarcodeExample
  1651. ///
  1652. /// <b>备注\n</b>
  1653. /// 1、在页模式下,此函数并不立即打印条码,而是一直到调用函数PageModePrint时才打印。\n
  1654. /// 2、此功能IMPACT类打印机不支持。
  1655. /// @return
  1656. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1657. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1658. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1659. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1660. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1661. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1662. int POSSDKCALL_MODE BarcodePrintPDF417Simple(DEVICEHANDLE hDev, char *szDataBuffer, int nStartX, int nStartY, int nWidth, int nHeight);
  1663. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1664. /// @~English
  1665. ///
  1666. /// @brief Set up and print the Maxicode barcode
  1667. ///
  1668. /// @param [in] hDev Device handle.
  1669. /// @param [in] szDataBuffer Points to a null-terminated string.
  1670. /// @param [in] nStartX The distance (dot/mm) from the left edge of the starting point in the X (horizontal) direction of the specified area. \n effective range is 0-65535 points.
  1671. /// @param [in] nStartY Specifies the distance (dot/mm) from the starting point in the Y direction (vertical) to the upper boundary. \n effective range is -1-65535 points. \n this parameter only takes effect when printed in page mode, fixed to "-1" when printed in standard mode (line mode).
  1672. /// @param [in] nBytesToPrint Total number of characters sent to the printer. No more than the length of szDataBuffer valid data.
  1673. ///
  1674. /// <b>The sample code\n</b>
  1675. /// See details @ref EG_PrintBarcodeExample
  1676. ///
  1677. /// <b>Remark\n</b>
  1678. /// 1.In page mode, this function does not immediately print the bar code, until the call function PageModePrint to print.\n
  1679. /// 2.This feature is only supported by POS class printers.
  1680. /// @return
  1681. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1682. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1683. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1684. /// ::ERR_NOT_SUPPORT -- @copybrief ::ERR_NOT_SUPPORT \n
  1685. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1686. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1687. /// @~Chinese
  1688. ///
  1689. /// @brief 设置并打印Maxicode条码
  1690. ///
  1691. /// @param [in] hDev 设备句柄。
  1692. /// @param [in] szDataBuffer 指向以 null 结尾的字符串。
  1693. /// @param [in] nStartX 指定区域的 X (水平)方向的起始点位置离左边界的距离(点/毫米)。\n 有效范围为 0 - 65535点。
  1694. /// @param [in] nStartY 指定 Y 方向(垂直)的起始点位置离上边界的距离(点/毫米)。\n 有效范围为-1 - 65535点。\n 该参数只有在页模式打印时生效,标准模式(行模式)打印时,固定为"-1"。
  1695. /// @param [in] nBytesToPrint 指定由参数 szDataBuffer指向的字符串个数,即将要发送给打印机的字符总数,不可大于szDataBuffer有效数据长度。
  1696. ///
  1697. /// <b>示例代码\n</b>
  1698. /// 详见 @ref EG_PrintBarcodeExample
  1699. ///
  1700. /// <b>备注\n</b>
  1701. /// 1、在页模式下,此函数并不立即打印条码,而是一直到调用函数PageModePrint时才打印。\n
  1702. /// 2、此功能仅POS类打印机支持。
  1703. /// @return
  1704. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1705. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1706. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1707. /// ::ERR_NOT_SUPPORT -- @copybrief ::ERR_NOT_SUPPORT \n
  1708. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1709. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1710. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1711. int POSSDKCALL_MODE BarcodePrintMaxicode(DEVICEHANDLE hDev, char *szDataBuffer, int nStartX, int nStartY, int nBytesToPrint);
  1712. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1713. /// @~English
  1714. /// @brief Set and print the GS1 barcode
  1715. ///
  1716. /// @param [in] hDev Device handle.
  1717. /// @param [in] szDataBuffer Points to a null-terminated string. The range and format allowed per character depends on the specific barcode type.
  1718. /// @param [in] nStartX The distance (dot/mm) from the left edge of the starting point in the X (horizontal) direction of the specified area. \n effective range is 0-65535 points.
  1719. /// @param [in] nStartY Specifies the distance (dot/mm) from the starting point in the Y direction (vertical) to the upper boundary. \n effective range is -1-65535 points. \n this parameter only takes effect when printed in page mode, fixed to "-1" when printed in standard mode (line mode).
  1720. /// @param [in] nBarcodeType Specify barcode GS1 type and character set. \n valid range is 1-7.
  1721. /// @param [in] nBasicWidth Specifies the number of base element widths of the bar code. \n effective range is 1-6 points.
  1722. /// @param [in] nHeight Specifies the height of the bar code (dot/mm). \n effective range is 2-250 points.
  1723. /// @param [in] nSegmentNum Specifies the number of segments in each line of the barcode symbol. \n valid range is 2-20.
  1724. /// @param [in] nSeparatorHeight Specifies the number of height points for the delimiter. \n valid range is 1-10 points.
  1725. /// @param [in] nBasicHeight Specifies the number of base elements height of the bar code. \n valid range is 1-10 points.
  1726. /// @param [in] nHRI Specify the type of font for HRI (Human Readable Interpretation) characters. The effective range of \n is 1-4.
  1727. /// @param [in] nAI Specifies whether the bar code is applied to AI (application identifier). \n valid range is 0-1. \n 0 means do not apply AI 1 means apply.
  1728. /// @param [in] nBytesToPrint Total number of characters sent to the printer. No more than the length of szDataBuffer valid data.
  1729. ///
  1730. /// <b>The sample code\n</b>
  1731. /// See details @ref EG_PrintBarcodeExample
  1732. ///
  1733. /// <b>Remark\n</b>
  1734. /// 1.In page mode, this function does not immediately print the bar code, until the call function PageModePrint to print.\n
  1735. /// 2.This feature is only supported by POS class printers.
  1736. /// @return
  1737. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1738. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1739. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1740. /// ::ERR_NOT_SUPPORT -- @copybrief ::ERR_NOT_SUPPORT \n
  1741. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1742. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1743. ///
  1744. /// @~Chinese
  1745. ///
  1746. /// @brief 设置并打印GS1条码
  1747. ///
  1748. /// @param [in] hDev 设备句柄。
  1749. /// @param [in] szDataBuffer 指向以 null 结尾的字符串。每个字符允许的范围和格式与具体条码类型有关。
  1750. /// @param [in] nStartX 指定区域的 X (水平)方向的起始点位置离左边界的距离(点/毫米)。\n 有效范围为 0 - 65535点。
  1751. /// @param [in] nStartY 指定 Y 方向(垂直)的起始点位置离上边界的距离(点/毫米)。\n 有效范围为-1 - 65535点。\n 该参数只有在页模式打印时生效,标准模式(行模式)打印时,固定为"-1"。
  1752. /// @param [in] nBarcodeType 指定条码GS1类型及字符集。\n 有效范围为 1 - 7。
  1753. /// @param [in] nBasicWidth 指定条码的基本元素宽度点数。\n 有效范围为 1 - 6 点。
  1754. /// @param [in] nHeight 指定条码的高度(点/毫米)。\n 有效范围为 2 - 250 点。
  1755. /// @param [in] nSegmentNum 指定条码每行条码符号的段数。\n 有效范围为 2 - 20。
  1756. /// @param [in] nSeparatorHeight 指定分隔符的高度点数。\n 有效范围为 1 - 10 点。
  1757. /// @param [in] nBasicHeight 指定条码的基本元素高度点数。\n 有效范围为 1 - 10 点。
  1758. /// @param [in] nHRI 指定 HRI(Human Readable Interpretation)字符的字体类型。\n 有效范围为 1 - 4。
  1759. /// @param [in] nAI 指定条码是否应用AI(应用标识符)。\n 有效范围为 0 - 1。\n 0表示不应用AI 1表示应用。
  1760. /// @param [in] nBytesToPrint 指定由参数 szDataBuffer指向的字符串个数,即将要发送给打印机的字符总数,不可大于szDataBuffer有效数据长度。
  1761. ///
  1762. /// <b>示例代码\n</b>
  1763. /// 详见 @ref EG_PrintBarcodeExample
  1764. ///
  1765. /// <b>备注\n</b>
  1766. /// 1、在页模式下,此函数并不立即打印条码,而是一直到调用函数PageModePrint时才打印。\n
  1767. /// 2、此功能仅POS类打印机支持。
  1768. /// @return
  1769. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1770. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1771. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1772. /// ::ERR_NOT_SUPPORT -- @copybrief ::ERR_NOT_SUPPORT \n
  1773. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1774. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1775. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1776. int POSSDKCALL_MODE BarcodePrintGS1DataBar(DEVICEHANDLE hDev, char *szDataBuffer, int nStartX, int nStartY, int nBarcodeType, int nBasicWidth, int nHeight, int nSegmentNum, int nSeparatorHeight, int nBasicHeight, int nHRI, int nAI, int nBytesToPrint);
  1777. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1778. /// @~English
  1779. ///
  1780. /// @brief Barcode reserve function
  1781. ///
  1782. /// @param [in] hDev Device handle.
  1783. /// @param [in] nInstructionName Reserve parameter 1.
  1784. /// @param [in] nPara1 Reserve parameter 2.
  1785. /// @param [in] szPara2 Reserve parameter 3.
  1786. ///
  1787. /// @return
  1788. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1789. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1790. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1791. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1792. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1793. ///
  1794. /// @~Chinese
  1795. ///
  1796. /// @brief 条码预留接口
  1797. ///
  1798. /// @param [in] hDev 设备句柄。
  1799. /// @param [in] nInstructionName 预留参数1。
  1800. /// @param [in] nPara1 预留参数2。
  1801. /// @param [in] szPara2 预留参数3。
  1802. ///
  1803. /// @return
  1804. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1805. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1806. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1807. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1808. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1809. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1810. int POSSDKCALL_MODE BarcodeReserveFunction(DEVICEHANDLE hDev, int nInstructionsName, int nPara1, char *szPara2);
  1811. // 文本
  1812. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1813. /// @~English
  1814. /// @brief Feed line
  1815. ///
  1816. /// @param [in] hDev Device handle.
  1817. ///
  1818. /// <b>The sample code\n</b>
  1819. /// See details @ref EG_PrintTextExample
  1820. ///
  1821. /// @return
  1822. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1823. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1824. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1825. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1826. ///
  1827. /// @~Chinese
  1828. /// @brief 换行
  1829. ///
  1830. /// @param [in] hDev 设备句柄。
  1831. ///
  1832. /// <b>示例代码\n</b>
  1833. /// 详见 @ref EG_PrintTextExample
  1834. ///
  1835. /// @return
  1836. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1837. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1838. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1839. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1840. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1841. int POSSDKCALL_MODE FeedLine(DEVICEHANDLE hDev);
  1842. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1843. /// @~English
  1844. /// @brief The string data to be printed is sent to the print buffer
  1845. ///
  1846. /// @param [in] hDev Device handle\n
  1847. /// @param [in] szTextData Points to a null-terminated string buffer.\n
  1848. /// @param [in] nStartX The distance (dot/mm) from the left edge of the starting point in the X (horizontal) direction of the specified area. \n effective range is 0-65535 points.\n
  1849. /// @param [in] nStartY Specifies the distance (dot/mm) from the starting point in the Y direction (vertical) to the upper boundary. \n effective range is -1-65535 points. \n this parameter only takes effect when printed in page mode, fixed to "-1" when printed in standard mode (line mode).\n
  1850. ///
  1851. ///
  1852. /// <b>The sample code\n</b>
  1853. /// See details @ref EG_PrintTextExample
  1854. ///
  1855. /// <b>Remark\n</b>
  1856. /// 1.This function does not immediately print the incoming string, until the FeedLine function is called. However, if the string passed in is already larger than the printable width, the paper is automatically fed and printed.\n
  1857. /// @return
  1858. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1859. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1860. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1861. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1862. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1863. ///
  1864. /// @~Chinese
  1865. /// @brief 将要打印的字符串数据发送到打印缓冲区
  1866. ///
  1867. /// @param [in] hDev 设备句柄。\n
  1868. /// @param [in] szTextData 指向以 null 结尾的字符串缓冲区。\n
  1869. /// @param [in] nStartX 指定区域的 X (水平)方向的起始点位置离左边界的距离(点/毫米)。\n 有效范围为 0 - 65535点。\n
  1870. /// @param [in] nStartY 指定 Y 方向(垂直)的起始点位置离上边界的距离(点/毫米)。\n 有效范围为-1 - 65535点。\n 该参数只有在页模式打印时生效,标准模式(行模式)打印时,固定为"-1"。\n
  1871. ///
  1872. ///
  1873. /// <b>示例代码\n</b>
  1874. /// 详见 @ref EG_PrintTextExample
  1875. ///
  1876. /// <b>备注\n</b>
  1877. /// 1、此函数并不立即打印传入的字符串,而是一直到调用函数 FeedLine 时才进行实际的进纸并打印的动作。但是,如果传入的字符串已经大于可打印宽度时,那么会自动进纸并打印。\n
  1878. /// @return
  1879. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1880. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1881. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1882. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1883. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1884. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1885. int POSSDKCALL_MODE PrintTextOut(DEVICEHANDLE hDev, char *szTextData, int nStartX, int nStartY);
  1886. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1887. /// @~English
  1888. /// @brief The string data to be printed is sent to the print buffer(support for amplification)
  1889. ///
  1890. /// @param [in] hDev Device handle
  1891. /// @param [in] szTextData Points to a null-terminated string buffer.
  1892. /// @param [in] nStartX The distance (dot/mm) from the left edge of the starting point in the X (horizontal) direction of the specified area. \n effective range is 0-65535 points.
  1893. /// @param [in] nStartY Specifies the distance (dot/mm) from the starting point in the Y direction (vertical) to the upper boundary. \n effective range is -1-65535 points. \n this parameter only takes effect when printed in page mode, fixed to "-1" when printed in standard mode (line mode).
  1894. /// @param [in] nWidthTimes Horizontal magnification, effective range 1-6.
  1895. /// @param [in] nHeightTimes Vertical magnification, effective range 1-6.
  1896. /// @param [in] nFontType Specifies the font type for the character. Can be one of the values listed in the following list:\n
  1897. /// Valid values | Meaning
  1898. /// ---------|----------------
  1899. /// 0 | Standard ASCII
  1900. /// 1 | Compression ASCII
  1901. /// 2 | User-defined characters
  1902. /// 3 | Standard "Song typeface"
  1903. ///
  1904. /// @param [in] nFontStyle Specifies the font style of the character. Can be one of the values listed in the following list:\n
  1905. /// Valid values(HEX) | implications
  1906. /// -----------|--------------------
  1907. /// 0x00 | Normal
  1908. /// 0x08 | Bold
  1909. /// 0x80 | 1 point bold underline
  1910. /// 0x100 | 2 bold underline
  1911. /// 0x200 | Inversion (only valid at the beginning of the line)
  1912. /// 0x400 | Reverse (white text on black background)
  1913. /// 0x800 | Smoothing (for magnification)
  1914. /// 0x1000 | Rotate each character 90 degrees clockwise
  1915. ///
  1916. /// <b>The sample code\n</b>
  1917. /// See details @ref EG_PrintTextExample
  1918. ///
  1919. /// <b>Remark\n</b>
  1920. /// 1.In the printer, generally, the internal font types are shown in the following table, but different models will be different, please refer to the test sample of the printer.\n
  1921. /// The name of the font | Font size (W * H)
  1922. /// ---------|------------------------
  1923. /// Standard ASCII | 12 * 24 / 13 * 24
  1924. /// Compressed ASCII | 9 * 17
  1925. /// Standard of song typeface | 24 * 24
  1926. /// Small song typeface | 16 * 16
  1927. /// Small ASCII | 8 * 16
  1928. ///
  1929. /// 2.If the character style is set to "reverse" or "rotate 90 degrees clockwise," then the "thin underscore" and "thick underscore" functions are disabled.\n
  1930. /// 3.If in Chinese character mode, standard ASCII characters (except partial symbols and symbols under full corners) and Chinese characters can be printed in one call. If in ASCII character mode, only standard ASCII characters and compressed ASCII characters can be printed.\n
  1931. /// 4.This function does not immediately print the incoming string, does not actually feed and print until the FeedLine function is called. However, if the string passed in is already larger than the printable width, the paper is automatically fed and printed.\n
  1932. ///
  1933. /// @return
  1934. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1935. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1936. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1937. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1938. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1939. ///
  1940. /// @~Chinese
  1941. /// @brief 将要打印的字符串数据发送到打印缓冲区(支持放大)
  1942. ///
  1943. /// @param [in] hDev 设备句柄。
  1944. /// @param [in] szTextData 指向以 null 结尾的字符串缓冲区。
  1945. /// @param [in] nStartX 指定区域的 X (水平)方向的起始点位置离左边界的距离(点/毫米)。\n 有效范围为 0 - 65535点。
  1946. /// @param [in] nStartY 指定 Y 方向(垂直)的起始点位置离上边界的距离(点/毫米)。\n 有效范围为-1 - 65535点。\n 该参数只有在页模式打印时生效,标准模式(行模式)打印时,固定为"-1"。
  1947. /// @param [in] nWidthTimes 横向放大倍数,有效范围为1-6。
  1948. /// @param [in] nHeightTimes 纵向放大倍数,有效范围为1-6。
  1949. /// @param [in] nFontType 指定字符的字体类型。可以为以下列表中所列值之一:\n
  1950. /// 有效值 | 含义
  1951. /// ---------|----------------
  1952. /// 0 | 标准 ASCII
  1953. /// 1 | 压缩 ASCII
  1954. /// 2 | 用户自定义字符
  1955. /// 3 | 标准 “宋体”
  1956. ///
  1957. /// @param [in] nFontStyle 指定字符的字体风格。可以为以下列表中所列值之一:\n
  1958. /// 有效值(HEX) | 含义
  1959. /// -----------|--------------------
  1960. /// 0x00 | 正常
  1961. /// 0x08 | 加粗
  1962. /// 0x80 | 1点粗的下划线
  1963. /// 0x100 | 2点粗的下划线
  1964. /// 0x200 | 倒置(只在行首有效)
  1965. /// 0x400 | 反显(黑底白字)
  1966. /// 0x800 | 平滑处理(用于放大时)
  1967. /// 0x1000 | 每个字符顺时针旋转 90 度
  1968. ///
  1969. /// <b>示例代码\n</b>
  1970. /// 详见 @ref EG_PrintTextExample
  1971. ///
  1972. /// <b>备注\n</b>
  1973. /// 1、在打印机中,一般内部已有字体类型如下表所示,但是不同机型会有所不同,可以参考打印机的测试样张。\n
  1974. /// 字体名称 | 字体大小(W * H)
  1975. /// ---------|------------------------
  1976. /// Standard ASCII | 12 * 24 / 13 * 24
  1977. /// Compressed ASCII | 9 * 17
  1978. /// 标准宋体 | 24 * 24
  1979. /// 小宋体 | 16 * 16
  1980. /// 小ASCII | 8 * 16
  1981. ///
  1982. /// 2、如果字符风格设置为“反显”,或“顺时针旋转90度”,那么“细下划线” 和“粗下划线”的功能将无效。\n
  1983. /// 3、如果在汉字字符模式下,则一次调用时,标准ASCII字符(除部分符号和全角下的符号)和汉字可以混合打印;如果在ASCII字符模式下,则只可以打印标准 ASCII 字符和压缩的ASCII字符。\n
  1984. /// 4、此函数并不立即打印传入的字符串,而是一直到调用函数 FeedLine 时才进行实际的进纸并打印的动作。但是,如果传入的字符串已经大于可打印宽度时,那么会自动进纸并打印。\n
  1985. ///
  1986. /// @return
  1987. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  1988. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  1989. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  1990. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  1991. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  1992. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1993. int POSSDKCALL_MODE UniversalTextOut(DEVICEHANDLE hDev, char *szTextData, int nStartX, int nStartY, int nWidthTimes, int nHeightTimes, int nFontType, int nFontStyle);
  1994. ////////////////////////////////////////////////////////////////////////////////////////////////////
  1995. /// @~English
  1996. /// @brief Sets text line hight
  1997. ///
  1998. /// @param [in] hDev Device handle.
  1999. /// @param [in] nLineHeight Specifies the high number of rows. The valid range is 0-255.
  2000. ///
  2001. /// <b>The sample code\n</b>
  2002. /// See details @ref EG_PrintTextExample
  2003. ///
  2004. /// <b>Remark\n</b>
  2005. /// 1.If the line height is set to 0, the printer USES the internal default line height, which is 1/6 of an inch. If the print head has a vertical resolution of 180dpi, it is 31 points high.\n
  2006. /// 2.If the line height is set to less than the current character height, the printer USES the current character height to be the line height.
  2007. /// @return
  2008. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2009. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2010. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2011. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2012. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2013. ///
  2014. /// @~Chinese
  2015. /// @brief 设置字符的行高
  2016. ///
  2017. /// @param [in] hDev 设备端口。
  2018. /// @param [in] nLineHeight 指定行高点数。有效范围为0-255。
  2019. ///
  2020. /// <b>示例代码\n</b>
  2021. /// 详见 @ref EG_PrintTextExample
  2022. ///
  2023. /// <b>备注\n</b>
  2024. /// 1、如果把行高设置为0,则打印机使用内部的默认行高值,即1 / 6英寸。如果打印头纵向分辨率为180dpi 则相当于 31 点高。\n
  2025. /// 2、如果行高被设置为小于当前的字符高度,则打印机将使用当前字符高度为行高。
  2026. /// @return
  2027. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2028. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2029. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2030. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2031. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2032. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2033. int POSSDKCALL_MODE SetTextLineHight(DEVICEHANDLE hDev, int nLineHeight);
  2034. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2035. /// @~English
  2036. /// @brief Sets text bold
  2037. ///
  2038. /// @param [in] hDev Device handle.
  2039. /// @param [in] nBold 0:no bold;1:bold.
  2040. ///
  2041. /// <b>The sample code\n</b>
  2042. /// Valid values @ref EG_PrintTextExample
  2043. /// @return
  2044. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2045. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2046. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2047. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2048. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2049. ///
  2050. /// @~Chinese
  2051. /// @brief 设置加粗
  2052. ///
  2053. /// @param [in] hDev 设备句柄。
  2054. /// @param [in] nBold 0:不加粗;1:加粗。
  2055. ///
  2056. /// <b>示例代码\n</b>
  2057. /// 详见 @ref EG_PrintTextExample
  2058. ///
  2059. /// @return
  2060. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2061. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2062. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2063. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2064. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2065. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2066. int POSSDKCALL_MODE SetTextBold(DEVICEHANDLE hDev, int nBold);
  2067. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2068. /// @~English
  2069. ///
  2070. /// @brief Sets text double width and height
  2071. ///
  2072. /// @param [in] hDev Device handle.
  2073. /// @param [in] nWidthEnable Text double width,0:Cancel double width;1:Choose double width.
  2074. /// @param [in] nHeightEnable Text double higeht,0:Cancel double higeht;1:Choose double higeht.
  2075. ///
  2076. /// <b>The sample code\n</b>
  2077. /// Valid values @ref EG_PrintTextExample
  2078. ///
  2079. /// @return
  2080. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2081. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2082. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2083. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2084. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2085. ///
  2086. /// @~Chinese
  2087. /// @brief 设置文本倍宽倍高使能
  2088. ///
  2089. /// @param [in] hDev 设备句柄。
  2090. /// @param [in] nWidthEnable 文本倍宽使能,0:取消倍宽;1:选择倍宽。
  2091. /// @param [in] nHeightEnable 文本倍高使能,0:取消倍高;1:选择倍高。
  2092. ///
  2093. /// <b>示例代码\n</b>
  2094. /// 详见 @ref EG_PrintTextExample
  2095. ///
  2096. /// @return
  2097. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2098. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2099. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2100. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2101. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2102. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2103. int POSSDKCALL_MODE SetTextDoubleWidthAndHeight(DEVICEHANDLE hDev, int nWidthEnable, int nHeightEnable);
  2104. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2105. /// @~English
  2106. ///
  2107. /// @brief Set the alignment of the printed text (only valid at the beginning of the line in standard mode)
  2108. ///
  2109. /// @param [in] hDev Device handle.
  2110. /// @param [in] nAlignment Alignment. Can be one of the values listed in the following list:\n
  2111. /// Valid values | Meaning
  2112. /// ---------|----------------
  2113. /// 0 | Left justified
  2114. /// 1 | In the middle
  2115. /// 2 | Right justified
  2116. ///
  2117. /// <b>The sample code\n</b>
  2118. /// See details @ref EG_PrintTextExample
  2119. ///
  2120. /// @return
  2121. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2122. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2123. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2124. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2125. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2126. ///
  2127. /// @~Chinese
  2128. ///
  2129. /// @brief 设置文本打印的对齐方式(只在标准模式的行首有效)
  2130. ///
  2131. /// @param [in] hDev 设备句柄。
  2132. /// @param [in] nAlignment 对齐方式。可以为以下列表中所列值之一:\n
  2133. /// 有效值 | 含义
  2134. /// ---------|----------------
  2135. /// 0 | 左对齐
  2136. /// 1 | 居中
  2137. /// 2 | 右对齐
  2138. ///
  2139. /// <b>示例代码\n</b>
  2140. /// 详见 @ref EG_PrintTextExample
  2141. ///
  2142. /// @return
  2143. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2144. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2145. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2146. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2147. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2148. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2149. int POSSDKCALL_MODE SetAlignmentMode(DEVICEHANDLE hDev, int nAlignment);
  2150. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2151. /// @~English
  2152. ///
  2153. /// @brief Sets text character space
  2154. ///
  2155. /// @param [in] hDev Device handle.
  2156. /// @param [in] nLeftSpace Character left spacing (this parameter should be valid when setting Chinese character spacing). The valid range is 0-255.
  2157. /// @param [in] nRightSpace Character right spacing. The valid range is 0-255.
  2158. /// @param [in] nMode Character mode. 0: Chinese character mode; 1: English character mode.
  2159. ///
  2160. /// <b>The sample code\n</b>
  2161. /// See details @ref EG_PrintTextExample
  2162. ///
  2163. /// <b>Remark\n</b>
  2164. /// 1.If the parameter Mode is 0, the parameter nLeftSpace and nRightSpace must both be legal; if the parameter Mode is 1, as long as the parameter nRightSpace is legal, the parameter LeftSpace is ignored.\n
  2165. /// 2.You can only change the character spacing in English or Chinese by calling textSetCharacterSpace once. To change the character spacing in Chinese and English, you need to call the function twice.
  2166. ///
  2167. /// @return
  2168. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2169. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2170. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2171. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2172. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2173. ///
  2174. /// @~Chinese
  2175. ///
  2176. /// @brief 设置字符间距
  2177. ///
  2178. /// @param [in] hDev 设备句柄。
  2179. /// @param [in] nLeftSpace 字符左间距(设置中文字符间距时,此参数需有效)。有效范围为0-255。
  2180. /// @param [in] nRightSpace 字符右间距。有效范围为0-255。
  2181. /// @param [in] nMode 字符模式。0:中文字符模式;1:英文字符模式。
  2182. ///
  2183. /// <b>示例代码\n</b>
  2184. /// 详见 @ref EG_PrintTextExample
  2185. ///
  2186. /// <b>备注\n</b>
  2187. /// 1、如果参数Mode为0,参数nLeftSpace和nRightSpace必须同时合法,如果参数Mode为1,只要参数nRightSpace合法便可,此时参数LeftSpace被忽略。\n
  2188. /// 2、调用一次函数textSetCharacterSpace只可以单独更改英文或中文的字符间距,若想更改中英文字符间距需要调用函数两次。
  2189. /// @return
  2190. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2191. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2192. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2193. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2194. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2195. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2196. int POSSDKCALL_MODE SetTextCharacterSpace(DEVICEHANDLE hDev, int nLeftSpace, int nRightSpace, int nMode);
  2197. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2198. /// @~English
  2199. ///
  2200. /// @brief Sets text magnify times
  2201. ///
  2202. /// @param [in] hDev Device handle.
  2203. /// @param [in] nHorMagnifyTimes Horizontal magnification, effective range 1-6.
  2204. /// @param [in] nVerMagnifyTimes Vertical magnification, effective range 1-6.
  2205. ///
  2206. /// <b>The sample code\n</b>
  2207. /// See details @ref EG_PrintTextExample
  2208. ///
  2209. /// <b>Remark\n</b>
  2210. /// 1.In standard mode, vertical is the direction of feed and horizontal is perpendicular to the direction of feed. But when the character is rotated 90 degrees clockwise, it is reversed horizontally and vertically.\n
  2211. /// 2.In page mode, landscape and portrait depend on the direction of the area.\n
  2212. /// 3.All characters are aligned with the bottom line.
  2213. ///
  2214. /// @return
  2215. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2216. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2217. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2218. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2219. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2220. ///
  2221. /// @~Chinese
  2222. ///
  2223. /// @brief 设置字符大小
  2224. ///
  2225. /// @param [in] hDev 设备句柄。
  2226. /// @param [in] nHorMagnifyTimes 横向放大倍数,有效范围为1-6。
  2227. /// @param [in] nVerMagnifyTimes 纵向放大倍数,有效范围为1-6。
  2228. ///
  2229. /// <b>示例代码\n</b>
  2230. /// 详见 @ref EG_PrintTextExample
  2231. ///
  2232. /// <b>备注\n</b>
  2233. /// 1、在标准模式下,纵向是进纸方向,横向是垂直于进纸的方向。但是当字符顺时针旋转90°时,横向和纵向颠倒。\n
  2234. /// 2、页模式下,横向和纵向取决于区域的方向。\n
  2235. /// 3、同一行字符的放大倍数不同时,所有的字符以底线对齐。
  2236. /// @return
  2237. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2238. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2239. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2240. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2241. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2242. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2243. int POSSDKCALL_MODE SetTextMagnifyTimes(DEVICEHANDLE hDev, int nHorMagnifyTimes, int nVerMagnifyTimes);
  2244. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2245. ///
  2246. /// @~English
  2247. /// @brief Select the font type for the print character
  2248. ///
  2249. /// @param [in] hDev Device handle.
  2250. /// @param [in] nFontType Font Type. Can be one of the values listed in the following list:\n
  2251. /// Valid values| Meaning
  2252. /// ---------|----------------
  2253. /// 0 | Standard ASCII
  2254. /// 1 | Compression ASCII
  2255. /// 2 | User-defined characters
  2256. /// 3 | Standard "Song typeface"
  2257. ///
  2258. /// <b>The sample code\n</b>
  2259. /// See details @ref EG_PrintTextExample
  2260. ///
  2261. /// @return
  2262. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2263. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2264. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2265. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2266. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2267. ///
  2268. /// @~Chinese
  2269. /// @brief 选择打印字符的字体类型
  2270. ///
  2271. /// @param [in] hDev 设备句柄。
  2272. /// @param [in] nFontType 指定字符的字体类型。可以为以下列表中所列值之一:\n
  2273. /// 有效值 | 含义
  2274. /// ---------|----------------
  2275. /// 0 | 标准 ASCII
  2276. /// 1 | 压缩 ASCII
  2277. /// 2 | 用户自定义字符
  2278. /// 3 | 标准 “宋体”
  2279. ///
  2280. /// <b>示例代码\n</b>
  2281. /// 详见 @ref EG_PrintTextExample
  2282. ///
  2283. /// @return
  2284. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2285. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2286. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2287. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2288. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2289. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2290. int POSSDKCALL_MODE SetTextFontType(DEVICEHANDLE hDev, int nFontStyle);
  2291. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2292. /// @~English
  2293. /// @brief Select whether to print upside down (only valid at the beginning of the line in standard mode)
  2294. ///
  2295. /// @param [in] hDev Device handle.
  2296. /// @param [in] nMode Specifies the font type for the character. 0: no upside down printing; 1: inverted printing.
  2297. ///
  2298. /// <b>The sample code\n</b>
  2299. /// See details @ref EG_PrintTextExample
  2300. ///
  2301. /// @return
  2302. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2303. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2304. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2305. ///
  2306. /// @~Chinese
  2307. /// @brief 选择是否倒置打印(只在标准模式的行首有效)
  2308. ///
  2309. /// @param [in] hDev 设备句柄。
  2310. /// @param [in] nMode 指定字符的字体类型。0:不倒置打印;1:倒置打印。
  2311. ///
  2312. /// <b>示例代码\n</b>
  2313. /// 详见 @ref EG_PrintTextExample
  2314. ///
  2315. /// @return
  2316. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2317. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2318. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2319. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2320. int POSSDKCALL_MODE SetTextUpsideDownMode(DEVICEHANDLE hDev, int nMode);
  2321. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2322. ///
  2323. /// @~English
  2324. /// @brief Select whether to print reverse or not
  2325. ///
  2326. /// @param [in] hDev Device handle.
  2327. /// @param [in] nEnable 0: no reverse 1: reverse .
  2328. ///
  2329. /// <b>The sample code\n</b>
  2330. /// See details @ref EG_PrintTextExample
  2331. ///
  2332. /// <b>Remark\n</b>
  2333. /// 1.In reverse mode, underline mode does not work.
  2334. ///
  2335. /// @return
  2336. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2337. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2338. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2339. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2340. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2341. ///
  2342. /// @~Chinese
  2343. /// @brief 选择是否反显打印
  2344. ///
  2345. /// @param [in] hDev 设备句柄。
  2346. /// @param [in] nEnable 0:不反显;1:反显。
  2347. ///
  2348. /// <b>示例代码\n</b>
  2349. /// 详见 @ref EG_PrintTextExample
  2350. ///
  2351. /// <b>备注\n</b>
  2352. /// 1、在反显打印模式选择时,下划线模式不起作用。
  2353. /// @return
  2354. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2355. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2356. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2357. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2358. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2359. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2360. int POSSDKCALL_MODE SetTextOppositeColor(DEVICEHANDLE hDev, int nEnable);
  2361. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2362. /// @~English
  2363. /// @brief Set underline
  2364. ///
  2365. /// @param [in] hDev Device handle.
  2366. /// @param [in] nMode 0: no underline is set; 1: one bold underline point; 2: two bold underlined points.
  2367. ///
  2368. /// <b>The sample code\n</b>
  2369. /// See details @ref EG_PrintTextExample
  2370. ///
  2371. /// <b>Remark\n</b>
  2372. /// 1.In reverse mode, underline mode does not work.\n
  2373. /// 2.This feature IMPACT class printers do not support nMode equals 2.
  2374. ///
  2375. /// @return
  2376. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2377. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2378. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2379. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2380. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2381. ///
  2382. /// @~Chinese
  2383. /// @brief 设置下划线
  2384. ///
  2385. /// @param [in] hDev 设备句柄。
  2386. /// @param [in] nMode 0:不设置下划线;1:一点粗下划线;2:两点粗下划线。
  2387. ///
  2388. /// <b>示例代码\n</b>
  2389. /// 详见 @ref EG_PrintTextExample
  2390. ///
  2391. /// <b>备注\n</b>
  2392. /// 1、在反显打印模式选择时,下划线模式不起作用。\n
  2393. /// 2、此功能IMPACT类打印机不支持nMode等于2。
  2394. /// @return
  2395. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2396. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2397. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2398. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2399. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2400. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2401. int POSSDKCALL_MODE SetTextUnderline(DEVICEHANDLE hDev, int nMode);
  2402. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2403. ///
  2404. /// @~English
  2405. /// @brief Sets text color enable
  2406. ///
  2407. /// @param [in] hDev Device handle.
  2408. /// @param [in] nEnable 0:unable; 1:enable.
  2409. ///
  2410. /// <b>Remark\n</b>
  2411. /// 1.This feature is only supported by POS class printers.
  2412. ///
  2413. /// @return
  2414. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2415. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2416. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2417. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2418. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2419. ///
  2420. /// @~Chinese
  2421. /// @brief 双色打印使能
  2422. ///
  2423. /// @param [in] hDev 设备句柄。
  2424. /// @param [in] nEnable 0:不使能;1:使能。
  2425. ///
  2426. /// <b>备注\n</b>
  2427. /// 1、此功能仅POS类打印机支持。
  2428. /// @return
  2429. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2430. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2431. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2432. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2433. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2434. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2435. int POSSDKCALL_MODE SetTextColorEnable(DEVICEHANDLE hDev, int nEnable);
  2436. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2437. ///
  2438. /// @~English
  2439. /// @brief Sets the color of the printed characters
  2440. ///
  2441. /// @param [in] hDev Device handle.
  2442. /// @param [in] nFontColor 0: color 1; 1: color 2.
  2443. ///
  2444. /// <b>Remark\n</b>
  2445. /// 1.This function is only supported by POS printers and IMPACT printers.
  2446. ///
  2447. /// @return
  2448. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2449. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2450. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2451. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2452. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2453. ///
  2454. /// @~Chinese
  2455. /// @brief 设置打印字符的颜色
  2456. ///
  2457. /// @param [in] hDev 设备句柄。
  2458. /// @param [in] nFontColor 0:颜色1;1:颜色2。
  2459. ///
  2460. /// <b>备注\n</b>
  2461. /// 1、此功能仅POS类打印机和IMPACT类打印机支持。
  2462. /// @return
  2463. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2464. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2465. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2466. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2467. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2468. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2469. int POSSDKCALL_MODE SetTextFontColor(DEVICEHANDLE hDev, int nFontColor);
  2470. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2471. ///
  2472. /// @~English
  2473. /// @brief Sets rotate enable
  2474. ///
  2475. /// @param [in] hDev Device handle.
  2476. /// @param [in] nEnable 0: cancel the rotation of 90 degrees to print; 1: choose to rotate 90 degrees to print.
  2477. ///
  2478. /// <b>The sample code\n</b>
  2479. /// See details @ref EG_PrintTextExample
  2480. ///
  2481. /// @return
  2482. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2483. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2484. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2485. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2486. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2487. ///
  2488. /// @~Chinese
  2489. /// @brief 顺时针旋转90°使能
  2490. ///
  2491. /// @param [in] hDev 设备句柄。
  2492. /// @param [in] nEnable 0:取消旋转90度打印;1:选择旋转90度打印。
  2493. ///
  2494. /// <b>示例代码\n</b>
  2495. /// 详见 @ref EG_PrintTextExample
  2496. ///
  2497. /// @return
  2498. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2499. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2500. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2501. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2502. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2503. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2504. int POSSDKCALL_MODE SetTextRotate(DEVICEHANDLE hDev, int nEnable);
  2505. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2506. ///
  2507. /// @~English
  2508. /// @brief Select the international character set and code page
  2509. ///
  2510. /// @param [in] hDev Device handle.
  2511. /// @param [in] nCharSet International character set, valid range see @subpage page_charset_eng.
  2512. /// @param [in] nCodePage International code page, valid range see @subpage page_codepage_eng.
  2513. ///
  2514. /// @return
  2515. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2516. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2517. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2518. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2519. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2520. ///
  2521. /// @~Chinese
  2522. /// @brief 选择国际字符集和代码页
  2523. ///
  2524. /// @param [in] hDev 设备句柄。
  2525. /// @param [in] nCharSet 国际字符集,有效范围详见 @subpage page_charset。
  2526. /// @param [in] nCodePage 国际代码页,有效范围详见 @subpage page_codepage。
  2527. ///
  2528. /// @return
  2529. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2530. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2531. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2532. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2533. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2534. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2535. int POSSDKCALL_MODE SetTextCharsetAndCodepage(DEVICEHANDLE hDev, int nCharSet, int nCodePage);
  2536. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2537. ///
  2538. /// @~English
  2539. /// @brief User-defined characters enable
  2540. ///
  2541. /// @param [in] hDev Device handle.
  2542. /// @param [in] nEnable 0: cancel user-defined characters; 1: select user-defined characters.
  2543. ///
  2544. /// @return
  2545. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2546. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2547. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2548. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2549. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2550. ///
  2551. /// @~Chinese
  2552. /// @brief 用户自定义字符使能
  2553. ///
  2554. /// @param [in] hDev 设备句柄。
  2555. /// @param [in] nEnable 0:取消用户自定义字符;1:选择用户自定义字符。
  2556. ///
  2557. /// @return
  2558. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2559. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2560. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2561. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2562. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2563. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2564. int POSSDKCALL_MODE SetTextUserDefinedCharacterEnable(DEVICEHANDLE hDev, int nEnable);
  2565. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2566. ///
  2567. /// @~English
  2568. /// @brief Defines user-defined characters
  2569. ///
  2570. /// @param [in] hDev Device handle.
  2571. /// @param [in] nStartCode Start character, valid range of 32-127.
  2572. /// @param [in] nEndCode Termination character, valid range 32-127.
  2573. /// @param [in] nFontType Specifies the font type for the character. Can be one of the values listed in the following list:\n
  2574. /// Valid values |Meaning
  2575. /// ---------|----------------
  2576. /// 0 | Standard ASCII
  2577. /// 1 | Compression ASCII
  2578. /// 2 | User-defined characters
  2579. /// 3 | Standard "Song typeface"
  2580. /// @param [in] szChData Character data.
  2581. ///
  2582. /// @return
  2583. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2584. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2585. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2586. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2587. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2588. ///
  2589. /// @~Chinese
  2590. /// @brief 定义用户自定义字符
  2591. ///
  2592. /// @param [in] hDev 设备句柄。
  2593. /// @param [in] nStartCode 起始字符,有效范围为32-127。
  2594. /// @param [in] nEndCode 终止字符,有效范围为32-127。
  2595. /// @param [in] nFontType 指定字符的字体类型。可以为以下列表中所列值之一:\n
  2596. /// 有效值 | 含义
  2597. /// ---------|----------------
  2598. /// 0 | 标准 ASCII
  2599. /// 1 | 压缩 ASCII
  2600. /// 2 | 用户自定义字符
  2601. /// 3 | 标准 “宋体”
  2602. /// @param [in] szChData 字符的数据。
  2603. ///
  2604. /// @return
  2605. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2606. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2607. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2608. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2609. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2610. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2611. int POSSDKCALL_MODE SetTextDefineUserDefinedCharacter(DEVICEHANDLE hDev, int nStartCode, int nEndCode, int nFontType, char *szChData);
  2612. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2613. ///
  2614. /// @~English
  2615. /// @brief Text setting reserve function interface
  2616. ///
  2617. /// @param [in] hDev Device handle.
  2618. /// @param [in] nInstructionName Property index value.
  2619. /// @param [in] nPara Property parameters.
  2620. /// @param [in] szPara Property parameters.
  2621. ///
  2622. /// @return
  2623. /// ::ERR_NOT_SUPPORT -- @copybrief ::ERR_NOT_SUPPORT \n
  2624. ///
  2625. /// @~Chinese
  2626. /// @brief 文本设置预留功能接口
  2627. ///
  2628. /// @param [in] hDev 设备句柄。
  2629. /// @param [in] nInstructionName 属性索引值。
  2630. /// @param [in] nPara 属性参数。
  2631. /// @param [in] szPara 属性参数。
  2632. ///
  2633. /// @return
  2634. /// ::ERR_NOT_SUPPORT -- @copybrief ::ERR_NOT_SUPPORT \n
  2635. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2636. int POSSDKCALL_MODE SetTextUniveral(DEVICEHANDLE hDev, int nInstructionName, int nPara, char *szPara);
  2637. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2638. ///
  2639. /// @~English
  2640. /// @brief Send files to the printer
  2641. ///
  2642. /// @param [in] hDev Device handle.
  2643. /// @param [in] szFilePath The file path to send to the printer.
  2644. ///
  2645. /// @return
  2646. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2647. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2648. /// ::ERR_FILE -- @copybrief ::ERR_FILE \n
  2649. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2650. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2651. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2652. ///
  2653. /// @~Chinese
  2654. ///
  2655. /// @brief 发送文件到打印机
  2656. ///
  2657. /// @param [in] hDev 设备句柄。
  2658. /// @param [in] szFilePath 所要发送到打印机的文件路径。
  2659. ///
  2660. /// @return
  2661. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2662. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2663. /// ::ERR_FILE -- @copybrief ::ERR_FILE \n
  2664. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2665. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2666. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2667. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2668. int POSSDKCALL_MODE DownloadFile(DEVICEHANDLE hDev, char *szFilePath);
  2669. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2670. ///
  2671. /// @~English
  2672. /// @brief Set the print mode for the printer
  2673. ///
  2674. /// @param [in] hDev Device handle.
  2675. /// @param [in] nPrintMode Specify the print mode. Can be one of the following values:
  2676. /// Valid values | Meaning
  2677. /// ---------|----------------
  2678. /// 0 | Standard mode(Line mode)
  2679. /// 1 | Page mode
  2680. ///
  2681. /// <b>The sample code\n</b>
  2682. /// See details @ref EG_BasicSetExample
  2683. ///
  2684. /// @return
  2685. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2686. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2687. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2688. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2689. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2690. ///
  2691. /// @~Chinese
  2692. ///
  2693. /// @brief 设置打印机的打印模式
  2694. ///
  2695. /// @param [in] hDev 设备句柄。
  2696. /// @param [in] nPrintMode 指定打印模式。可以为以下值之一:
  2697. /// 有效值 | 含义
  2698. /// ---------|----------------
  2699. /// 0 | 标准模式(行模式)
  2700. /// 1 | 页模式
  2701. ///
  2702. /// <b>示例代码\n</b>
  2703. /// 详见 @ref EG_BasicSetExample
  2704. ///
  2705. /// @return
  2706. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2707. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2708. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2709. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2710. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2711. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2712. int POSSDKCALL_MODE PrintSetMode(DEVICEHANDLE hDev, int nPrintMode);
  2713. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2714. ///
  2715. /// @~English
  2716. /// @brief Set the print area of the page
  2717. ///
  2718. /// @param [in] hDev Device handle.
  2719. /// @param [in] nStartX The distance (dot/mm) from the left edge of the starting point in the X (horizontal) direction of the specified area. \n effective range is 0-65535 points.\n
  2720. /// @param [in] nStartY Specifies the distance (dot/mm) from the starting point in the Y direction (vertical) to the upper boundary. \n effective range is -1-65535 points. \n this parameter only takes effect when printed in page mode, fixed to "-1" when printed in standard mode (line mode).
  2721. /// @param [in] nWidth Specifies the width (horizontal) of the print area. \n effective range is 0-65535 points.
  2722. /// @param [in] nHeight Specifies the height (vertical) of the print area. \n effective range is 0-65535 points.
  2723. /// @param [in] nDirection Specifies the direction (origin position) of the print area. Can be one of the following values:
  2724. /// Valid values | Meaning
  2725. /// ---------|----------------
  2726. /// 0 | Top left
  2727. /// 1 | Bottom left
  2728. /// 2 | Bottom riget
  2729. /// 3 | Top right
  2730. ///
  2731. /// <b>The sample code\n</b>
  2732. /// See details @ref EG_BasicSetExample
  2733. ///
  2734. /// <b>Remark\n</b>
  2735. /// 1.The width of the printable area is different because different printer models have different print head widths (or internal buffer widths). Similarly, the height of the printable area may vary, typically 128 × 8 points, if the values specified by the parameters nWidth and nHeight exceed this limit. Then the printable area is automatically set to the actual printable area.\n
  2736. /// 2.If the width or height of the print area is set to 0, the printer stops processing instructions and treats the data it receives as normal character data.\n
  2737. /// 3.If the starting point of the print area exceeds the printer's printable area, the printer stops processing instructions and treats the data it receives as ordinary character data.
  2738. /// @return
  2739. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2740. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2741. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2742. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2743. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2744. ///
  2745. /// @~Chinese
  2746. ///
  2747. /// @brief 设置页面的打印区域
  2748. ///
  2749. /// @param [in] hDev 设备句柄。
  2750. /// @param [in] nStartX 指定区域的 X (水平)方向的起始点位置离左边界的距离(点/毫米)。\n 有效范围为 0 - 65535点。
  2751. /// @param [in] nStartY 指定 Y 方向(垂直)的起始点位置离上边界的距离(点/毫米)。\n 有效范围为-1 - 65535点。\n 该参数只有在页模式打印时生效,标准模式(行模式)打印时,固定为"-1"。
  2752. /// @param [in] nWidth 指定打印区域的宽度(水平方向)。\n 有效范围为 0 - 65535点。
  2753. /// @param [in] nHeight 指定打印区域的高度(垂直方向)。\n 有效范围为 0 - 65535点。
  2754. /// @param [in] nDirection 指定打印区域的方向(原点位置)。可以为以下值之一:
  2755. /// 有效值 | 含义
  2756. /// ---------|----------------
  2757. /// 0 | 左上角
  2758. /// 1 | 左下角
  2759. /// 2 | 右下角
  2760. /// 3 | 右上角
  2761. ///
  2762. /// <b>示例代码\n</b>
  2763. /// 详见 @ref EG_BasicSetExample
  2764. ///
  2765. /// <b>备注\n</b>
  2766. /// 1、由于不同的打印机型号有不同的打印头宽度(或内部缓冲区的宽度),所以可打印区域的宽度是不同的。同样,可打印区域的高度也有可能不同,一般大约是 128 × 8 点,如果参数 nWidth 和 nHeight 所指定的值超过此限制。那么可打印区域自动设置为实际的可打印区域。\n
  2767. /// 2、如果打印区域的宽度或高度设置为0,则打印机停止指令的处理,而将随后接受到的数据都当作普通的字符数据。\n
  2768. /// 3、如果打印区域的起始点超出打印机的可打印区域,则打印机停止指令的处理,而将随后接受到的数据都当作普通的字符数据。
  2769. /// @return
  2770. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2771. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2772. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2773. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2774. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2775. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2776. int POSSDKCALL_MODE PageModeSetArea(DEVICEHANDLE hDev, int nStartX, int nStartY, int nWidth, int nHeight, int nDirection);
  2777. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2778. ///
  2779. /// @~English
  2780. /// @brief Print the data in the page or label buffer
  2781. ///
  2782. /// @param [in] hDev Device handle.
  2783. ///
  2784. /// <b>The sample code\n</b>
  2785. /// See details @ref EG_BasicSetExample
  2786. ///
  2787. /// <b>Remark\n</b>
  2788. /// 1.If the function succeeds, it enters the paper and prints the ticket, but the page buffer or label buffer contents remain, and you can call this function again to continue printing the ticket in the page buffer or label buffer.\n
  2789. /// 2.You can call the PageModeClearBuffer to clear the page buffer or label buffer.\n
  2790. /// 3.Please refer to PrintSetMode。
  2791. /// @return
  2792. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2793. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2794. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2795. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2796. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2797. ///
  2798. /// @~Chinese
  2799. ///
  2800. /// @brief 打印页或标签缓冲区中的数据
  2801. ///
  2802. /// @param [in] hDev 设备句柄。
  2803. ///
  2804. /// <b>示例代码\n</b>
  2805. /// 详见 @ref EG_BasicSetExample
  2806. ///
  2807. /// <b>备注\n</b>
  2808. /// 1、如果函数成功,则将进纸并打印票面,但是页缓冲区或标签缓冲区内容还是被保留着,可以再次调用此函数继续打印页缓冲区或标签缓冲区中的票面。\n
  2809. /// 2、可以调用 PageModeClearBuffer 来清除页缓冲区或标签缓冲区中的数据。\n
  2810. /// 3、另请参考 PrintSetMode。
  2811. /// @return
  2812. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2813. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2814. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2815. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2816. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2817. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2818. int POSSDKCALL_MODE PageModePrint(DEVICEHANDLE hDev);
  2819. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2820. /// @~English
  2821. /// @brief Remove ticket and label print buffer data
  2822. ///
  2823. /// @param [in] hDev Device handle.
  2824. ///
  2825. /// <b>The sample code\n</b>
  2826. /// See details @ref EG_BasicSetExample
  2827. ///
  2828. /// <b>Remark\n</b>
  2829. /// 1.If the function succeeds, the current page buffer inside the printer is cleared.\n
  2830. /// 2.Please also refer to PageModePrint, PrintSetMode.\n
  2831. /// 3.This feature is not supported by the IMPACT class printer.
  2832. /// @return
  2833. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2834. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2835. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2836. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2837. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2838. ///
  2839. /// @~Chinese
  2840. ///
  2841. /// @brief 清除票面和标签的打印缓冲区中的数据
  2842. ///
  2843. /// @param [in] hDev 设备句柄。
  2844. ///
  2845. /// <b>示例代码\n</b>
  2846. /// 详见 @ref EG_BasicSetExample
  2847. ///
  2848. /// <b>备注\n</b>
  2849. /// 1、如果函数成功,则打印机内部的当前页缓冲区被清除。\n
  2850. /// 2、另请参考 PageModePrint,PrintSetMode。\n
  2851. /// 3、此功能IMPACT类打印机不支持。
  2852. /// @return
  2853. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2854. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2855. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2856. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2857. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2858. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2859. int POSSDKCALL_MODE PageModeClearBuffer(DEVICEHANDLE hDev);
  2860. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2861. /// @~English
  2862. /// @brief Feed paper
  2863. ///
  2864. /// @param [in] hDev Device handle.
  2865. /// @param [in] nLineNum Feed paper length. \n effective range 0-255 dots.
  2866. ///
  2867. /// @return
  2868. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2869. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2870. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2871. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2872. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2873. /// @~Chinese
  2874. ///
  2875. /// @brief 走纸一段距离
  2876. ///
  2877. /// @param [in] hDev 设备句柄。
  2878. /// @param [in] nLineNum 走纸长度。\n 有效范围为 0 - 255 点。
  2879. ///
  2880. /// @return
  2881. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2882. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2883. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2884. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2885. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2886. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2887. int POSSDKCALL_MODE FeedLineNumber(DEVICEHANDLE hDev, int nLineNum);
  2888. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2889. /// @~English
  2890. /// @brief Cut paper
  2891. ///
  2892. /// @param [in] hDev Device handle.
  2893. /// @param [in] nCutMode Specify Cut paper mode. \n can be one of the following values:
  2894. /// Valid values | Meaning
  2895. /// ---------|----------------
  2896. /// 0 | Full cut
  2897. /// 1 | Feed paper and half cut
  2898. /// 2 | Feed paper and full cut
  2899. /// 3 | Half cut
  2900. /// @param [in] nDistance The number of points that specify the length of the feed. \n valid range is 0-255.
  2901. ///
  2902. /// <b>The sample code\n</b>
  2903. /// See details @ref EG_BasicSetExample
  2904. ///
  2905. /// <b>Remark\n</b>
  2906. /// 1.If 0 (full cut) or 3 (half cut) is selected, the printer will cut the paper immediately after printing, and the parameter nDistance is ignored.\n
  2907. /// 2.If you choose 1 (take a distance and cut in half) or 2 (Feed paper and full cut), then the printer takes the nDistance point and cuts the paper.\n
  2908. /// 3.If the current paper type is black label paper, select 1 (Feed paper and half cut) or 2 (Feed paper and full cut) to position the black label and cut the paper.\n
  2909. /// 4.Please also refer to PrintSetMode.
  2910. /// @return
  2911. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2912. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2913. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2914. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2915. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2916. ///
  2917. /// @~Chinese
  2918. ///
  2919. /// @brief 切纸
  2920. ///
  2921. /// @param [in] hDev 设备句柄。
  2922. /// @param [in] nCutMode 指定切纸模式。\n 可以为以下值之一:
  2923. /// 有效值 | 含义
  2924. /// ---------|----------------
  2925. /// 0 | 全切
  2926. /// 1 | 走纸一段距离并半切
  2927. /// 2 | 走纸一段距离并全切
  2928. /// 3 | 半切
  2929. /// @param [in] nDistance 指定进纸长度的点数。\n 有效范围为 0 - 255。
  2930. ///
  2931. /// <b>示例代码\n</b>
  2932. /// 详见 @ref EG_BasicSetExample
  2933. ///
  2934. /// <b>备注\n</b>
  2935. /// 1、如果选择0(全切)或3(半切),则打印机打印完成立刻切纸,参数 nDistance 忽略。\n
  2936. /// 2、如果选择1(走纸一段距离并半切)或2(走纸一段距离并全切),则打印机走纸 nDistance 点,然后切纸。\n
  2937. /// 3、如果当前纸张类型为黑标纸,选择1(走纸一段距离并半切)或2(走纸一段距离并全切)时定位黑标并切纸。\n
  2938. /// 4、另请参考 PrintSetMode。
  2939. /// @return
  2940. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2941. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  2942. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2943. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2944. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2945. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2946. int POSSDKCALL_MODE CutPaper(DEVICEHANDLE hDev, int nCutMode, int nDistance);
  2947. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2948. /// @~English
  2949. ///
  2950. /// @brief Resets the printer, clears the print buffer of data, clears the character and line height Settings, and returns the print mode to the default mode when powered on
  2951. ///
  2952. /// @param [in] hDev Device handle.
  2953. ///
  2954. /// <b>The sample code\n</b>
  2955. /// See details @ref EG_BasicSetExample
  2956. ///
  2957. /// <b>Remark\n</b>
  2958. /// After the function is successfully executed, then:\n
  2959. /// 1.Receive instructions in the buffer and keep them.\n
  2960. /// 2.Preserve macro definition\n
  2961. /// 3.Save the bitmap in Flash.\n
  2962. /// 4.Save the data in Flash\n
  2963. /// 5.The DIP switch setting is not checked again.
  2964. /// @return
  2965. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2966. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2967. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2968. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2969. ///
  2970. /// @~Chinese
  2971. ///
  2972. /// @brief 复位打印机,把打印缓冲区中的数据清除,字符和行高的设置被清除,打印模式被恢复到上电时的缺省模式
  2973. ///
  2974. /// @param [in] hDev 设备句柄。
  2975. ///
  2976. /// <b>示例代码\n</b>
  2977. /// 详见 @ref EG_BasicSetExample
  2978. ///
  2979. /// <b>备注\n</b>
  2980. /// 函数成功执行后,则:\n
  2981. /// 1、接收缓冲区中的指令保留。\n
  2982. /// 2、宏定义保留。\n
  2983. /// 3、Flash 中的位图保留。\n
  2984. /// 4、Flash 中的数据保留。\n
  2985. /// 5、DIP开关的设置不进行再次检测。
  2986. /// @return
  2987. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  2988. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  2989. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  2990. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  2991. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2992. int POSSDKCALL_MODE Reset(DEVICEHANDLE hDev);
  2993. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2994. /// @~English
  2995. /// @brief Send pulses to drawer pin to open the drawer
  2996. ///
  2997. /// @param [in] hDev Device handle.
  2998. /// @param [in] nID Specify the pin of drawer.\n Can be one of the following values:
  2999. /// Valid values | Meaning
  3000. /// ---------|----------------
  3001. /// 0 | Drawer connector pin 2
  3002. /// 1 | Drawer connector pin 5
  3003. /// @param [in] nOnTimes Specifies the holding time for high level pulses sent to the drawer, nOnTimes × 2 ms. \n valid range is 0-255.
  3004. /// @param [in] nOffTimes Specifies the holding time for low level pulses sent to the drawer, nOnTimes × 2 ms. \n valid range is 0-255.
  3005. ///
  3006. /// <b>Remark\n</b>
  3007. /// 1.If the value of the parameter nOffTimes is less than nOnTimes, the low level pulse sent to the money box remains nOnTimes × 2 milliseconds.\n
  3008. /// 2.Please refer to the relevant materials provided by the money box supplier.\n
  3009. /// 3.This feature is supported only for POS printers and IMPACT printers.
  3010. /// @return
  3011. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3012. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3013. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3014. /// ::ERR_NOT_SUPPORT -- @copybrief ::ERR_NOT_SUPPORT \n
  3015. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3016. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3017. ///
  3018. /// @~Chinese
  3019. ///
  3020. /// @brief 往钱箱引脚发送脉冲以打开钱箱
  3021. ///
  3022. /// @param [in] hDev 设备句柄。
  3023. /// @param [in] nID 指定钱箱的引脚。\n 可以为以下值之一:
  3024. /// 有效值 | 含义
  3025. /// ---------|----------------
  3026. /// 0 | 钱箱连接器引脚2
  3027. /// 1 | 钱箱连接器引脚5
  3028. /// @param [in] nOnTimes 指定往钱箱发送的高电平脉冲保持时间,即 nOnTimes × 2 毫秒。\n 有效范围为 0 - 255。
  3029. /// @param [in] nOffTimes 指定往钱箱发送的低电平脉冲保持时间,即 nOffTimes × 2 毫秒。\n 有效范围为 0 - 255。
  3030. ///
  3031. /// <b>备注\n</b>
  3032. /// 1、如果参数 nOffTimes 的值小于 nOnTimes, 则往钱箱发送的低电平脉冲的保持时间为nOnTimes × 2 毫秒。\n
  3033. /// 2、请参考钱箱供应商提供的相关资料。\n
  3034. /// 3、此功能仅POS类打印机和IMPACT类打印机支持。
  3035. /// @return
  3036. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3037. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3038. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3039. /// ::ERR_NOT_SUPPORT -- @copybrief ::ERR_NOT_SUPPORT \n
  3040. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3041. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3042. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3043. int POSSDKCALL_MODE KickOutDrawer(DEVICEHANDLE hDev, int nID, int nOnTimes, int nOffTimes);
  3044. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3045. /// @~English
  3046. /// @brief Sets the application unit of the printer
  3047. ///
  3048. /// @param [in] hDev Device handle.
  3049. /// @param [in] nUnit Specifies the application unit of the printer. \n can be one of the following values:
  3050. /// Valid values | Meaning
  3051. /// ---------|----------------
  3052. /// 0 | dot
  3053. /// 1 | millimetre
  3054. ///
  3055. /// <b>The sample code\n</b>
  3056. /// See details @ref EG_BasicSetExample
  3057. ///
  3058. /// <b>Remark\n</b>
  3059. /// 1.The default resolution is 203*203. If the current printer resolution is not 203*203, please first call the MotionUnit interface to set the resolution, and then do other operations.
  3060. ///
  3061. /// @~Chinese
  3062. /// @brief 设置打印机的应用单位
  3063. ///
  3064. /// @param [in] hDev 设备句柄。
  3065. /// @param [in] nUnit 指定打印机的应用单位。\n 可以为以下值之一:
  3066. /// 有效值 | 含义
  3067. /// ---------|----------------
  3068. /// 0 | 点
  3069. /// 1 | 毫米
  3070. ///
  3071. /// <b>示例代码\n</b>
  3072. /// 详见 @ref EG_BasicSetExample
  3073. ///
  3074. /// <b>备注\n</b>
  3075. /// 1、默认的分辨率为203*203,如果当前打印机分辨率非203*203,请先调用MotionUnit接口,设置分辨率,再进行其他操作。\n
  3076. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3077. void POSSDKCALL_MODE ApplicationUnit(DEVICEHANDLE hDev, int nUnit);
  3078. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3079. /// @~English
  3080. /// @brief Set print density
  3081. ///
  3082. /// @param [in] hDev Device handle.
  3083. /// @param [in] nDensity Specifies the print concentration of the printer. \n valid range is 1-140. \n print concentration increases with the value.
  3084. ///
  3085. /// <b>The sample code\n</b>
  3086. /// See details @ref EG_BasicSetExample
  3087. ///
  3088. /// <b>Remark\n</b>
  3089. /// 1.The printing density is set by this function, and the printer fails after restart. The printing density after restart is subject to the EEPROM setting of the printer.
  3090. /// @return
  3091. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3092. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3093. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3094. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3095. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3096. ///
  3097. /// @~Chinese
  3098. ///
  3099. /// @brief 设置打印浓度
  3100. ///
  3101. /// @param [in] hDev 设备句柄。
  3102. /// @param [in] nDensity 指定打印机的打印浓度。\n 有效范围为 1 - 140。\n 打印浓度随数值增大而增加。
  3103. ///
  3104. /// <b>示例代码\n</b>
  3105. /// 详见 @ref EG_BasicSetExample
  3106. ///
  3107. /// <b>备注\n</b>
  3108. /// 1、通过该函数设置打印浓度,打印机重启后失效,重启后的打印浓度以打印机的EEPROM设置为准。
  3109. /// @return
  3110. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3111. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3112. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3113. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3114. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3115. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3116. int POSSDKCALL_MODE PrintDensity(DEVICEHANDLE hDev, int nDensity);
  3117. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3118. /// @~English
  3119. /// @brief Set the printer's mobile unit (resolution)
  3120. ///
  3121. /// @param [in] hDev Device handle.
  3122. /// @param [in] nHorizontalMU Horizontal printer resolution. The effective value of \n is 180, 203 and 300.
  3123. /// @param [in] nVerticalMU Printer longitudinal resolution. The effective value of \n is 180, 203 and 300.
  3124. ///
  3125. /// <b>The sample code\n</b>
  3126. /// See details @ref EG_BasicSetExample
  3127. ///
  3128. /// <b>Remark\n</b>
  3129. /// 1.Please refer to ::PrintSetMode。\n
  3130. /// 2.The resolution set must be consistent with the actual printer resolution.\n
  3131. /// 3.Set after opening the port。
  3132. /// @return
  3133. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3134. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3135. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3136. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3137. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3138. ///
  3139. /// @~Chinese
  3140. ///
  3141. /// @brief 设置打印机的移动单位(分辨率)
  3142. ///
  3143. /// @param [in] hDev 设备句柄。
  3144. /// @param [in] nHorizontalMU 打印机横向分辨率。\n 有效值为180、203、300。
  3145. /// @param [in] nVerticalMU 打印机纵向分辨率。\n 有效值为180、203、300。
  3146. ///
  3147. /// <b>示例代码\n</b>
  3148. /// 详见 @ref EG_BasicSetExample
  3149. ///
  3150. /// <b>备注\n</b>
  3151. /// 1、另请参考 ::PrintSetMode。\n
  3152. /// 2、设置的分辨率必须与打印机实际分辨率一致。\n
  3153. /// 3、在打开端口后设置。
  3154. /// @return
  3155. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3156. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3157. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3158. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3159. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3160. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3161. int POSSDKCALL_MODE MotionUnit(DEVICEHANDLE hDev, int nHorizontalMU, int nVerticalMU);
  3162. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3163. /// @~English
  3164. ///
  3165. /// @brief Set the paper type for the printer
  3166. ///
  3167. /// @param [in] hDev Device handle.
  3168. /// @param [in] nPaperType Specifies the paper type for the printer. \n can be one of the following values:
  3169. /// Valid values | Meaning
  3170. /// ---------|----------------
  3171. /// 0 | Continuous paper
  3172. /// 1 | Black tag label paper
  3173. /// 2 | White tag label paper
  3174. ///
  3175. /// @return
  3176. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3177. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3178. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3179. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3180. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3181. ///
  3182. /// @~Chinese
  3183. ///
  3184. /// @brief 设置打印机的纸张类型
  3185. ///
  3186. /// @param [in] hDev 设备句柄。
  3187. /// @param [in] nPaperType 指定打印机的纸张类型。\n 可以为以下值之一:
  3188. /// 有效值 | 含义
  3189. /// ---------|----------------
  3190. /// 0 | 连续纸
  3191. /// 1 | 黑标记标签纸
  3192. /// 2 | 白标记标签纸
  3193. ///
  3194. /// @return
  3195. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3196. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3197. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3198. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3199. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3200. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3201. int POSSDKCALL_MODE SelectPaperType(DEVICEHANDLE hDev, int nPaperType);
  3202. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3203. /// @~English
  3204. ///
  3205. /// @brief Set the paper type of the printer (reset to take effect)
  3206. ///
  3207. /// @param [in] hDev Devcice handle.
  3208. /// @param [in] nPaperType Specifies the paper type of the printer. \n can be one of the following values:
  3209. /// Valid values | Meaning
  3210. /// ---------|----------------
  3211. /// 0 | Continuous paper
  3212. /// 1 | Black tag label paper
  3213. /// 2 | White tag label paper
  3214. ///
  3215. /// @return
  3216. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3217. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3218. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3219. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3220. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3221. ///
  3222. /// @~Chinese
  3223. ///
  3224. /// @brief 设置打印机的纸张类型(复位生效)
  3225. ///
  3226. /// @param [in] hDev 设备句柄。
  3227. /// @param [in] nPaperType 指定打印机的纸张类型。\n 可以为以下值之一:
  3228. /// 有效值 | 含义
  3229. /// ---------|----------------
  3230. /// 0 | 连续纸
  3231. /// 1 | 黑标记标签纸
  3232. /// 2 | 白标记标签纸
  3233. ///
  3234. /// @return
  3235. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3236. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3237. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3238. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3239. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3240. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3241. int POSSDKCALL_MODE SelectPaperTypeEEP(DEVICEHANDLE hDev, int nPaperType);
  3242. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3243. /// @~English
  3244. /// @brief Basic Settings reserve interface
  3245. ///
  3246. /// @param [in] hDev Device handle.
  3247. /// @param [in] nInstructionName Reserve parameter 1.
  3248. /// @param [in] nPara1 Reserve parameter 2.
  3249. /// @param [in] szPara2 Reserve parameter 3.
  3250. ///
  3251. /// @return
  3252. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3253. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3254. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3255. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3256. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3257. ///
  3258. /// @~Chinese
  3259. ///
  3260. /// @brief 基本设置预留接口
  3261. ///
  3262. /// @param [in] hDev 设备句柄。
  3263. /// @param [in] nInstructionName 预留参数1。
  3264. /// @param [in] nPara1 预留参数2。
  3265. /// @param [in] szPara2 预留参数3。
  3266. ///
  3267. /// @return
  3268. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3269. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3270. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3271. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3272. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3273. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3274. int POSSDKCALL_MODE BasicSetReserveFunction(DEVICEHANDLE hDev, int nInstructionName, int nPara1, char *szPara2);
  3275. // 查询
  3276. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3277. /// @~English
  3278. /// @brief Real time query of printer status
  3279. /// @param [in] hDev Device handle.
  3280. /// @param [out] szStatus Returns a buffer of printer status with a buffer size of 1 byte.
  3281. /// @param [in] nDataLength Points to the length of the buffer that returns the status of the printer.
  3282. /// @param [out] nRealDataLength Returns the length of the actual printer state.
  3283. ///
  3284. /// <b>The sample code\n</b>
  3285. /// See details @ref EG_QueryExample
  3286. ///
  3287. /// <b>State analysis\n</b>
  3288. /// See details @ref EG_RealTimeStatus
  3289. ///
  3290. /// <b>Remark\n</b>
  3291. /// 1.The printer status corresponds to szStatus returned by different types of printers is different. The specific status is as follows:\n
  3292. /// ① POS-type printing device status analysis see detail @subpage page_realpos_eng .\n
  3293. /// ② KIOSK class printing device status analysis see details @subpage page_realkiosk_eng .\n
  3294. /// ③ TKIOSK class printing device status analysis see details @subpage page_realtkiosk_eng .\n
  3295. /// ④ IMPACT class printing device status analysis see details @subpage page_realimpact_eng .\n
  3296. /// 2.State analysis is applicable to most printers. If the analysis bit does not match the reality, please refer to the programming manual of the relevant model.
  3297. /// @return
  3298. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3299. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3300. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3301. ///
  3302. /// @~Chinese
  3303. /// @brief 实时查询打印机状态
  3304. ///
  3305. /// @param [in] hDev 设备句柄。
  3306. /// @param [out] szStatus 返回打印机状态的缓冲区,缓冲区大小为 1 个字节。
  3307. /// @param [in] nDataLength 指向返回打印机状态的缓冲区的长度。
  3308. /// @param [out] nRealDataLength 返回实际打印机状态的长度。
  3309. ///
  3310. /// <b>示例代码\n</b>
  3311. /// 详见 @ref EG_QueryExample
  3312. ///
  3313. /// <b>状态解析\n</b>
  3314. /// 详见 @ref EG_RealTimeStatus
  3315. ///
  3316. /// <b>备注\n</b>
  3317. /// 1、不同类型的打印机返回的szStatus对应的打印机状态不一样,具体状态解析如下:\n
  3318. /// ① POS类打印设备状态解析详见 @subpage page_realpos 。\n
  3319. /// ② KIOSK类打印设备状态解析详见 @subpage page_realkiosk 。\n
  3320. /// ③ TKIOSK类打印设备状态解析详见 @subpage page_realtkiosk 。\n
  3321. /// ④ IMPACT类打印设备状态解析详见 @subpage page_realimpact 。\n
  3322. /// 2、状态解析适用大部分打印机,若解析位与实际不符,请参考相关机型的编程手册。
  3323. /// @return
  3324. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3325. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3326. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3327. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3328. int POSSDKCALL_MODE RealTimeQueryStatus(DEVICEHANDLE hDev, char *szStatus, int nDataLength, unsigned long *nRealDataLength);
  3329. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3330. ///
  3331. /// @~English
  3332. /// @brief Non-real-time query of printer status
  3333. ///
  3334. /// @param [in] hDev Device handle.
  3335. /// @param [out] szStatus Returns a buffer of printer status with a buffer size of 1 byte.
  3336. /// @param [in] nDataLength Points to the length of the buffer that returns the status of the printer.
  3337. /// @param [out] nRealDataLength Returns the length of the actual printer state.
  3338. ///
  3339. /// <b>Remark\n</b>
  3340. /// 1.szStatus State analysis
  3341. /// Hex|Status | Meaning
  3342. /// --------|-----------|------------
  3343. /// 0x03 | 0 / 1 | Paper feeder has paper / Paper will run out
  3344. /// 0x0C | 0 / 1 | There is paper at the print head / No paper
  3345. /// 0x30 | 0 / 1 | Cashbox connector pin 3 is low (off) / high (on)
  3346. ///
  3347. /// 2.Among them, the POS type printing device and the IMPACT type printing device support the cash box status inquiry, and the KIOSK type printing device and the TKIOSK type printing device do not support the cash box status inquiry.
  3348. /// @return
  3349. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3350. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3351. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3352. ///
  3353. /// @~Chinese
  3354. /// @brief 非实时查询打印机状态
  3355. ///
  3356. /// @param [in] hDev 设备句柄。
  3357. /// @param [out] szStatus 返回打印机状态的缓冲区,缓冲区大小为 1 个字节。
  3358. /// @param [in] nDataLength 指向返回打印机状态的缓冲区的长度。
  3359. /// @param [out] nRealDataLength 返回实际打印机状态的长度。
  3360. ///
  3361. /// <b>备注\n</b>
  3362. /// 1、szStatus状态解析
  3363. /// Hex|Status | Meaning
  3364. /// --------|-----------|------------
  3365. /// 0x03 | 0 / 1 | 容纸器中有纸 / 纸将用尽
  3366. /// 0x0C | 0 / 1 | 打印头处有纸 / 无纸
  3367. /// 0x30 | 0 / 1 | 钱箱连接器引脚 3 的电平为低(关闭) / 高(打开)
  3368. ///
  3369. /// 2、其中POS类打印设备和IMPACT类打印设备支持钱箱状态查询,KIOSK类打印设备和TKIOSK类打印设备不支持钱箱状态查询。
  3370. /// @return
  3371. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3372. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3373. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3374. ///
  3375. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3376. int POSSDKCALL_MODE NonRealTimeQueryStatus(DEVICEHANDLE hDev, char *szStatus, int nDataLength, unsigned long *nRealDataLength);
  3377. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3378. ///
  3379. /// @~English
  3380. /// @brief Automatic status returns query printer status
  3381. ///
  3382. /// @param [in] hDev Device handle.
  3383. /// @param [out] szStatus Returns a buffer of printer status with a buffer size of at least 4 bytes.
  3384. /// @param [in] nDataLength Points to the length of the buffer that returns the status of the printer.
  3385. /// @param [in] nEnable Automatic status return enable
  3386. /// Valid values | Meaning
  3387. /// ---------|----------------
  3388. /// 0 | Turn off automatic status return
  3389. /// 1 | Enable automatic status return and read status
  3390. /// @param [out] nRealDataLength Returns the length of the actual printer state.
  3391. ///
  3392. /// <b>The sample code\n</b>
  3393. /// See details @ref EG_AutoQueryStatus
  3394. ///
  3395. /// <b>State analysis\n</b>
  3396. /// See details @ref EG_AutoStatus
  3397. ///
  3398. /// <b>Remark\n</b>
  3399. /// 1.The printer status corresponding to szStatus returned by different types of printers is different. The specific status is as follows:\n
  3400. /// ① For automatic state resolution of POS-type printing devices, see @subpage page_autopos_eng .\n
  3401. /// ② The automatic state resolution of KIOSK printing equipment, see @subpage page_autokiosk_eng .\n
  3402. /// ③ Automatic status analysis of TKIOSK printing devices see @subpage page_autotkiosk_eng .\n
  3403. /// ④ IMPACT class printing device automatic state resolution, see @subpage page_autoimpact_eng .\n
  3404. /// 2.State analysis is applicable to most printers. If the resolution bit does not match the actual one, please refer to the programming manual of the relevant model.
  3405. /// @return
  3406. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3407. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3408. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3409. ///
  3410. /// @~Chinese
  3411. /// @brief 自动状态返回查询打印机状态
  3412. ///
  3413. /// @param [in] hDev 设备句柄。
  3414. /// @param [out] szStatus 返回打印机状态的缓冲区,缓冲区大小至少为 4 个字节。
  3415. /// @param [in] nDataLength 指向返回打印机状态的缓冲区的长度。
  3416. /// @param [in] nEnable 自动状态返回使能
  3417. /// 有效值 | 含义
  3418. /// ---------|----------------
  3419. /// 0 | 关闭自动状态返回
  3420. /// 1 | 使能自动状态返回并读取状态
  3421. /// @param [out] nRealDataLength 返回实际打印机状态的长度。
  3422. ///
  3423. /// <b>示例代码\n</b>
  3424. /// 详见 @ref EG_AutoQueryStatus
  3425. ///
  3426. /// <b>状态解析\n</b>
  3427. /// 详见 @ref EG_AutoStatus
  3428. ///
  3429. /// <b>备注\n</b>
  3430. /// 1、不同类型的打印机返回的szStatus对应的打印机状态不一样,具体状态解析如下:\n
  3431. /// ① POS类打印设备自动状态解析详见 @subpage page_autopos 。\n
  3432. /// ② KIOSK类打印设备自动状态解析详见 @subpage page_autokiosk 。\n
  3433. /// ③ TKIOSK类打印设备自动状态解析详见 @subpage page_autotkiosk 。\n
  3434. /// ④ IMPACT类打印设备自动状态解析详见 @subpage page_autoimpact 。\n
  3435. /// 2、状态解析适用大部分打印机,若解析位与实际不符,请参考相关机型的编程手册。
  3436. /// @return
  3437. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3438. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3439. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3440. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3441. int POSSDKCALL_MODE AutoQueryStatus(DEVICEHANDLE hDev, char *szStatus, int nDataLength, int nEnable, unsigned long *nRealDataLength);
  3442. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3443. ///
  3444. /// @~English
  3445. /// @brief Get the firmware version number of the printer
  3446. ///
  3447. /// @param [in] hDev Device handle.
  3448. /// @param [out] szFirmwareVersion Returns the buffer of the firmware version number with a buffer size of at least 20 bytes.
  3449. /// @param [in] nDataLength Points to the length of the buffer that returns the firmware version number.
  3450. /// @param [out] nRealDataLength Returns the length of the actual firmware version number.
  3451. ///
  3452. /// <b>The sample code\n</b>
  3453. /// See details @ref EG_QueryExample
  3454. ///
  3455. /// @return
  3456. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3457. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3458. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3459. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3460. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3461. ///
  3462. /// @~Chinese
  3463. /// @brief 获取打印机的固件版本号
  3464. ///
  3465. /// @param [in] hDev 设备句柄。
  3466. /// @param [out] szFirmwareVersion 返回固件版本号的缓冲区,缓冲区大小至少为 20 个字节。
  3467. /// @param [in] nDataLength 指向返回固件版本号的缓冲区的长度。
  3468. /// @param [out] nRealDataLength 返回实际固件版本号的长度。
  3469. ///
  3470. /// <b>示例代码\n</b>
  3471. /// 详见 @ref EG_QueryExample
  3472. ///
  3473. /// @return
  3474. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3475. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3476. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3477. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3478. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3479. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3480. int POSSDKCALL_MODE FirmwareVersion(DEVICEHANDLE hDev, char *szFirmwareVersion, int nDataLength, unsigned long *nRealDataLength);
  3481. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3482. ///
  3483. /// @~English
  3484. /// @brief Obtain the software version number
  3485. ///
  3486. /// @param [in] hDev Device handle.
  3487. /// @param [out] szSoftwareVersion Returns the buffer of the software version number with a buffer size of at least 8 bytes.
  3488. /// @param [in] nDataLength The length of the buffer pointing to the returned software version number.
  3489. /// @param [out] nRealDataLength Returns the length of the actual software version number.
  3490. ///
  3491. /// <b>The sample code\n</b>
  3492. /// See details @ref EG_QueryExample
  3493. ///
  3494. /// @return
  3495. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3496. ///
  3497. /// @~Chinese
  3498. /// @brief 获取软件版本号
  3499. ///
  3500. /// @param [in] hDev 设备句柄。
  3501. /// @param [out] szSoftwareVersion 返回的软件版本号的缓冲区,缓冲区大小至少为 8 个字节。
  3502. /// @param [in] nDataLength 指向返回的软件版本号的缓冲区的长度。
  3503. /// @param [out] nRealDataLength 返回实际的软件版本号的长度。
  3504. ///
  3505. /// <b>示例代码\n</b>
  3506. /// 详见 @ref EG_QueryExample
  3507. ///
  3508. /// @return
  3509. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3510. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3511. int POSSDKCALL_MODE SoftwareVersion(DEVICEHANDLE hDev, char *szSoftwareVersion, int nDataLength, unsigned long *nRealDataLength);
  3512. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3513. /// @~English
  3514. /// @brief Get printer vendor information
  3515. ///
  3516. /// @param [in] hDev Device handle.
  3517. /// @param [out] szVendorInformation Returns a buffer of vendor information with a buffer size of at least 4 bytes.
  3518. /// @param [in] nDataLength Points to the length of the buffer that returns vendor information.
  3519. /// @param [out] nRealDataLength Returns the length of the actual vendor information.
  3520. ///
  3521. /// <b>The sample code\n</b>
  3522. /// See details @ref EG_QueryExample
  3523. ///
  3524. /// @return
  3525. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3526. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3527. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3528. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3529. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3530. ///
  3531. /// @~Chinese
  3532. ///
  3533. /// @brief 获取打印机的厂商信息
  3534. ///
  3535. /// @param [in] hDev 设备句柄。
  3536. /// @param [out] szVendorInformation 返回厂商信息的缓冲区,缓冲区大小至少为 4 个字节。
  3537. /// @param [in] nDataLength 指向返回厂商信息的缓冲区的长度。
  3538. /// @param [out] nRealDataLength 返回实际厂商信息的长度。
  3539. ///
  3540. /// <b>示例代码\n</b>
  3541. /// 详见 @ref EG_QueryExample
  3542. ///
  3543. /// @return
  3544. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3545. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3546. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3547. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3548. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3549. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3550. int POSSDKCALL_MODE VendorInformation(DEVICEHANDLE hDev, char *szVendorInformation, int nDataLength, unsigned long *nRealDataLength);
  3551. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3552. ///
  3553. /// @~English
  3554. /// @brief Get the name of the printer
  3555. ///
  3556. /// @param [in] hDev Device handle
  3557. /// @param [out] szPrinterName Returns a buffer of the printer name with a buffer size of at least 4 bytes.
  3558. /// @param [in] nDataLength Points to the length of the buffer that returns the printer name.
  3559. /// @param [out] nRealDataLength Returns the length of the actual printer name.
  3560. ///
  3561. /// <b>The sample code\n</b>
  3562. /// Valid values @ref EG_QueryExample
  3563. ///
  3564. /// @return
  3565. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3566. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3567. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3568. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3569. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3570. ///
  3571. /// @~Chinese
  3572. /// @brief 获取打印机的名称
  3573. ///
  3574. /// @param [in] hDev 设备句柄。
  3575. /// @param [out] szPrinterName 返回打印机名称的缓冲区,缓冲区大小至少为 4 个字节。
  3576. /// @param [in] nDataLength 指向返回打印机名称的缓冲区的长度。
  3577. /// @param [out] nRealDataLength 返回实际打印机名称的长度。
  3578. ///
  3579. /// <b>示例代码\n</b>
  3580. /// 详见 @ref EG_QueryExample
  3581. ///
  3582. /// @return
  3583. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3584. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3585. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3586. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3587. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3588. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3589. int POSSDKCALL_MODE PrinterName(DEVICEHANDLE hDev, char *szPrinterName, int nDataLength, unsigned long *nRealDataLength);
  3590. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3591. ///
  3592. /// @~English
  3593. /// @brief Get the resolution of the printer
  3594. ///
  3595. /// @param [in] hDev Device handle.
  3596. /// @param [out] szResolutionRatio Returns a buffer of the printer name with a buffer size of 2 bytes.\n
  3597. /// The first byte represents the horizontal resolution, 0x01 means 203dpi, 0x02 means 180dpi\n
  3598. /// The second byte represents the vertical resolution, 0x01 means 203dpi, 0x02 means 180dpi\n
  3599. /// @param [in] nDataLength Points to the length of the buffer that returns the resolution of the printer.
  3600. /// @param [out] nRealDataLength Returns the length of the actual printer resolution.
  3601. ///
  3602. /// <b>The sample code\n</b>
  3603. /// See details @ref EG_QueryExample
  3604. ///
  3605. /// @return
  3606. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3607. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3608. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3609. /// ::ERR_FIRNOSUPPORT -- @copybrief ::ERR_FIRNOSUPPORT \n
  3610. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3611. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3612. ///
  3613. /// @~Chinese
  3614. /// @brief 获取打印机的分辨率
  3615. ///
  3616. /// @param [in] hDev 设备句柄。
  3617. /// @param [out] szResolutionRatio 返回打印机名称的缓冲区,缓冲区大小为2个字节。\n
  3618. /// 第一个字节代表横向分辨率,0x01表示203dpi,0x02表示180dpi\n
  3619. /// 第二个字节代表纵向分辨率,0x01表示203dpi,0x02表示180dpi\n
  3620. /// @param [in] nDataLength 指向返回打印机分辨率的缓冲区的长度。
  3621. /// @param [out] nRealDataLength 返回实际打印机分辨率的长度。
  3622. ///
  3623. /// <b>示例代码\n</b>
  3624. /// 详见 @ref EG_QueryExample
  3625. ///
  3626. /// @return
  3627. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3628. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3629. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3630. /// ::ERR_FIRNOSUPPORT -- @copybrief ::ERR_FIRNOSUPPORT \n
  3631. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3632. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3633. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3634. int POSSDKCALL_MODE ResolutionRatio(DEVICEHANDLE hDev, char *szResolutionRatio, int nDataLength, unsigned long *nRealDataLength);
  3635. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3636. ///
  3637. /// @~English
  3638. /// @brief Get the hardware serial number of the printer
  3639. ///
  3640. /// @param [in] hDev Device handle
  3641. /// @param [out] szHardwareSerialNumber Returns a buffer of the printer hardware serial number with a buffer size of at least 4 bytes.\n
  3642. /// @param [in] nDataLength Points to the length of the buffer that returns the serial number of the printer hardware.
  3643. /// @param [out] nRealDataLength Returns the length of the actual printer hardware serial number.
  3644. ///
  3645. /// <b>The sample code\n</b>
  3646. /// See details @ref EG_QueryExample
  3647. ///
  3648. /// @return
  3649. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3650. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3651. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3652. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3653. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3654. ///
  3655. /// @~Chinese
  3656. /// @brief 获取打印机的硬件序列号
  3657. ///
  3658. /// @param [in] hDev 设备句柄。
  3659. /// @param [out] szHardwareSerialNumber 返回打印机硬件序列号的缓冲区,缓冲区大小至少为4个字节。\n
  3660. /// @param [in] nDataLength 指向返回打印机硬件序列号的缓冲区的长度。
  3661. /// @param [out] nRealDataLength 返回实际打印机硬件序列号的长度。
  3662. ///
  3663. /// <b>示例代码\n</b>
  3664. /// 详见 @ref EG_QueryExample
  3665. ///
  3666. /// @return
  3667. /// ::ERR_SUCCESS -- @copybrief ::ERR_SUCCESS \n
  3668. /// ::ERR_PARAMATER -- @copybrief ::ERR_PARAMATER \n
  3669. /// ::ERR_FAIL -- @copybrief ::ERR_FAIL \n
  3670. /// ::ERR_LOADDLL_FAILURE -- @copybrief ::ERR_LOADDLL_FAILURE \n
  3671. /// ::ERR_HANDLE -- @copybrief ::ERR_HANDLE \n
  3672. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3673. int POSSDKCALL_MODE HardwareSerialNumber(DEVICEHANDLE hDev, char *szHardwareSerialNumber, int nDataLength, unsigned long *nRealDataLength);
  3674. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3675. /// @~English
  3676. /// @brief Status query reservation interface
  3677. ///
  3678. /// @param hDev Device handle.
  3679. /// @param nInstructionsName Attribute value
  3680. /// @param nPara Function parameter
  3681. /// @param szPara Function parameter
  3682. ///
  3683. /// @return
  3684. /// ::ERR_NOT_SUPPORT -- @copybrief ::ERR_NOT_SUPPORT \n
  3685. ///
  3686. /// @~Chinese
  3687. /// @brief 状态查询预留接口
  3688. ///
  3689. /// @param hDev 设备句柄。
  3690. /// @param nInstructionsName 属性值。
  3691. /// @param nPara 功能参数。
  3692. /// @param szPara 功能参数。
  3693. ///
  3694. /// @return
  3695. /// ::ERR_NOT_SUPPORT -- @copybrief ::ERR_NOT_SUPPORT \n
  3696. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3697. int POSSDKCALL_MODE QueryReserveFunction(DEVICEHANDLE hDev, int nInstructionsName, int nPara, char *szPara, unsigned long *nRealDataLength);
  3698. // 日志
  3699. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3700. /// @~English
  3701. /// @brief Logging
  3702. /// @param hDev The development.
  3703. /// @param [in,out] szFileName If non-null, filename of the file.
  3704. /// @param [in,out] szFilePath If non-null, full pathname of the file.
  3705. /// @param nOpen The open.
  3706. ///
  3707. /// @return A POSSDKCALL_MODE.
  3708. ///
  3709. /// @~Chinese
  3710. ///
  3711. /// @brief 记录日志
  3712. /// @param hDev The development.
  3713. /// @param [in,out] szFileName If non-null, filename of the file.
  3714. /// @param [in,out] szFilePath If non-null, full pathname of the file.
  3715. /// @param nOpen The open.
  3716. ///
  3717. /// @return A POSSDKCALL_MODE.
  3718. ////////////////////////////////////////////////////////////////////////////////////////////////////
  3719. int POSSDKCALL_MODE InstructionsRecord(DEVICEHANDLE hDev, char *szFileName, char *szFilePath, int nOpen);
  3720. #ifdef __cplusplus
  3721. }
  3722. #endif
  3723. /// 通讯
  3724. typedef int (POSSDKCALL_MODE *pSDKGetVersionInfo)(char *szVersionInfo, int nInfoLength, int *npInforTrueLen);
  3725. typedef int (POSSDKCALL_MODE *pEnumDeviceInfo1)(int nOperationType, char *szDeviceNameBuf, int nBufLen, int *npNumber);
  3726. typedef DEVICEHANDLE(POSSDKCALL_MODE *pInit)(char *szPrinterName);
  3727. typedef int (POSSDKCALL_MODE *pOpenCOMPort)(DEVICEHANDLE hDev, char *szName, int nComBaudrate, int nComDataBits, int nComStopBits, int nComParity, int nParam);
  3728. typedef int (POSSDKCALL_MODE *pOpenLPTPort)(DEVICEHANDLE hDev, char *szName);
  3729. typedef int (POSSDKCALL_MODE *pOpenUsbApiPort)(DEVICEHANDLE hDev, int nDeviceId);
  3730. typedef int (POSSDKCALL_MODE *pOpenUsbClassPort)(DEVICEHANDLE hDev, char *szName, int nIsSplitStatus);
  3731. typedef int (POSSDKCALL_MODE *pOpenNetPortByName)(DEVICEHANDLE hDev, char *szName);
  3732. typedef int (POSSDKCALL_MODE *pOpenNetPort)(DEVICEHANDLE hDev, char *szNetIP, int nPort, int nProtocalType, int nBroadcast);
  3733. typedef int (POSSDKCALL_MODE *pOpenBlueToothPortByName)(DEVICEHANDLE hDev, char *szName);
  3734. typedef int (POSSDKCALL_MODE *pOpenBlueToothPort)(DEVICEHANDLE hDev, char *szMACAddress);
  3735. typedef int (POSSDKCALL_MODE *pOpenBlueToothPortMFI)(DEVICEHANDLE hDev, char *szMACAddress);
  3736. typedef int (POSSDKCALL_MODE *pOpenDriverPort)(DEVICEHANDLE hDev, char *szName);
  3737. typedef int (POSSDKCALL_MODE *pClosePort11)(DEVICEHANDLE hDev);
  3738. typedef int (POSSDKCALL_MODE *pSendPortData)(DEVICEHANDLE hDev, char *szData, int nDataLength, int *npReturnLen);
  3739. typedef int (POSSDKCALL_MODE *pReadPortData)(DEVICEHANDLE hDev, char *szData, int nDataLength, int *npReturnLen);
  3740. typedef int (POSSDKCALL_MODE *pSetPortTimeout)(DEVICEHANDLE hDev, int nWriteTimeout, int nReadTimeout);
  3741. typedef int (POSSDKCALL_MODE *pGetPortTimeout)(DEVICEHANDLE hDev, int *nWriteTimeout, int *nReadTimeout);
  3742. /// 位图
  3743. typedef int (POSSDKCALL_MODE *pPrintBitmap)(DEVICEHANDLE hDev, char *szFilePath, int nStartX, int nStartY, int nType);
  3744. typedef int (POSSDKCALL_MODE *pPrintBitmapByMode)(DEVICEHANDLE hDev, char *szFilePath, int nStartX, int nStartY, int nMode);
  3745. typedef int (POSSDKCALL_MODE *pPrintTrueType)(DEVICEHANDLE hDev, char *szText, int nStartX, int nStartY, char *szFontName, int nFontHeight, int nFontWidth, int nBold);
  3746. typedef int (POSSDKCALL_MODE *pDownloadRAMBitmapByFile)(DEVICEHANDLE hDev, char *szFilePath, int nImageID);
  3747. typedef int (POSSDKCALL_MODE *pPrintRAMBitmap)(DEVICEHANDLE hDev, int nImageID, int nStartX, int nStartY, int nMode);
  3748. typedef int (POSSDKCALL_MODE *pDownloadFlashBitmapByFile)(DEVICEHANDLE hDev, char *szFilePath[], int nImageCount);
  3749. typedef int (POSSDKCALL_MODE *pPrintFlashBitmap)(DEVICEHANDLE hDev, int nImageID, int nStartX, int nStartY, int nMode);
  3750. /// 条码
  3751. typedef int (POSSDKCALL_MODE *pPrintBarcode)(DEVICEHANDLE hDev, char *szDataBuffer, int nStartX, int nStartY, int nType, int nBasicWidth, int nHeight, int nHriFontType, int nHriFontPosition, int nBytesToPrint);
  3752. typedef int (POSSDKCALL_MODE *pPrintBarcodeSimple)(DEVICEHANDLE hDev, char *szDataBuffer, int nStartX, int nStartY, int nType, int nWidth, int nHeight, int nHriFontPosition);
  3753. typedef int (POSSDKCALL_MODE *pBarcodePrintQR)(DEVICEHANDLE hDev, char *szDataBuffer, int nStartX, int nStartY, int nBasicWidth, int nSymbolType, int nLanguageMode, int nErrorCorrect, int nBytesToPrint);
  3754. typedef int (POSSDKCALL_MODE *pBarcodePrintQREx)(DEVICEHANDLE hDev, char *szDataBuffer, int nStartX, int nStartY, int nBasicWidth, int nErrorCorrect, int nBytesToPrint);
  3755. typedef int (POSSDKCALL_MODE *pBarcodePrintPDF417)(DEVICEHANDLE hDev, char *szDataBuffer, int nStartX, int nStartY, int nBasicWidth, int nHeight, int nLines, int nColumns, int nScaleH, int nScaleV, int nCorrectGrade, int nBytesToPrint);
  3756. typedef int (POSSDKCALL_MODE *pBarcodePrintPDF417Simple)(DEVICEHANDLE hDev, char *szDataBuffer, int nStartX, int nStartY, int nWidth, int nHeight);
  3757. typedef int (POSSDKCALL_MODE *pBarcodePrintMaxicode)(DEVICEHANDLE hDev, char *szDataBuffer, int nStartX, int nStartY, int nBytesToPrint);
  3758. typedef int (POSSDKCALL_MODE *pBarcodePrintGS1DataBar)(DEVICEHANDLE hDev, char *szDataBuffer, int nStartX, int nStartY, int nBarcodeType, int nBasicWidth, int nHeight, int nSegmentNum, int nSeparatorHeight, int nBasicHeight, int nHRI, int nAI, int nBytesToPrint);
  3759. typedef int (POSSDKCALL_MODE *pBarcodeReserveFunction)(DEVICEHANDLE hDev, int nInstructionsName, int nPara1, char *szPara2);
  3760. /// 文本
  3761. typedef int (POSSDKCALL_MODE *pFeedLine)(DEVICEHANDLE hDev);
  3762. typedef int (POSSDKCALL_MODE *pPrintTextOut)(DEVICEHANDLE hDev, char *szTextData, int nStartX, int nStartY);
  3763. typedef int (POSSDKCALL_MODE *pUniversalTextOut)(DEVICEHANDLE hDev, char *szTextData, int nStartX, int nStartY, int nWidthTimes, int nHeightTimes, int nFontType, int nFontStyle);
  3764. typedef int (POSSDKCALL_MODE *pSetTextLineHight)(DEVICEHANDLE hDev, int nLineHeight);
  3765. typedef int (POSSDKCALL_MODE *pSetTextBold)(DEVICEHANDLE hDev, int nBold);
  3766. typedef int (POSSDKCALL_MODE *pSetTextDoubleWidthAndHeight)(DEVICEHANDLE hDev, int nWidthEnable, int nHeightEnable);
  3767. typedef int (POSSDKCALL_MODE *pSetAlignmentMode)(DEVICEHANDLE hDev, int nAlignment);
  3768. typedef int (POSSDKCALL_MODE *pSetTextCharacterSpace)(DEVICEHANDLE hDev, int nLeftSpace, int nRightSpace, int nMode);
  3769. typedef int (POSSDKCALL_MODE *pSetTextMagnifyTimes)(DEVICEHANDLE hDev, int nHorMagnifyTimes, int nVerMagnifyTimes);
  3770. typedef int (POSSDKCALL_MODE *pSetTextFontType)(DEVICEHANDLE hDev, int nFontStyle);
  3771. typedef int (POSSDKCALL_MODE *pSetTextUpsideDownMode)(DEVICEHANDLE hDev, int nMode);
  3772. typedef int (POSSDKCALL_MODE *pSetTextOppositeColor)(DEVICEHANDLE hDev, int nEnable);
  3773. typedef int (POSSDKCALL_MODE *pSetTextColorEnable)(DEVICEHANDLE hDev, int nEnable);
  3774. typedef int (POSSDKCALL_MODE *pSetTextFontColor)(DEVICEHANDLE hDev, int nFontColor);
  3775. typedef int (POSSDKCALL_MODE *pSetTextUnderline)(DEVICEHANDLE hDev, int nMode);
  3776. typedef int (POSSDKCALL_MODE *pSetTextRotate)(DEVICEHANDLE hDev, int nEnable);
  3777. typedef int (POSSDKCALL_MODE *pSetTextCharsetAndCodepage)(DEVICEHANDLE hDev, int nCharSet, int nCodePage);
  3778. typedef int (POSSDKCALL_MODE *pSetTextUserDefinedCharacterEnable)(DEVICEHANDLE hDev, int nEnable);
  3779. typedef int (POSSDKCALL_MODE *pSetTextDefineUserDefinedCharacter)(DEVICEHANDLE hDev, int nStartCode, int nEndCode, int nFontType, char *szChData);
  3780. typedef int (POSSDKCALL_MODE *pSetTextUniveral)(DEVICEHANDLE hDev, int nInstructionName, int nPara1, char *szPara2);
  3781. /// 基本设置
  3782. typedef int (POSSDKCALL_MODE *pDownloadFile)(DEVICEHANDLE hDev, char *szFilePath);
  3783. typedef int (POSSDKCALL_MODE *pPrintSetMode)(DEVICEHANDLE hDev, int nPrintMode);
  3784. typedef int (POSSDKCALL_MODE *pPageModeSetArea)(DEVICEHANDLE hDev, int nStartX, int nStartY, int nWidth, int nHeight, int nDirection);
  3785. typedef int (POSSDKCALL_MODE *pPageModePrint)(DEVICEHANDLE hDev);
  3786. typedef int (POSSDKCALL_MODE *pPageModeClearBuffer)(DEVICEHANDLE hDev);
  3787. typedef int (POSSDKCALL_MODE *pFeedLineNumber)(DEVICEHANDLE hDev, int nLineNum);
  3788. typedef int (POSSDKCALL_MODE *pCutPaper)(DEVICEHANDLE hDev, int nCutMode, int nDistance);
  3789. typedef int (POSSDKCALL_MODE *pReset)(DEVICEHANDLE hDev);
  3790. typedef int (POSSDKCALL_MODE *pKickOutDrawer)(DEVICEHANDLE hDev, int nID, int nOnTimes, int nOffTimes);
  3791. typedef int (POSSDKCALL_MODE *pApplicationUnit)(DEVICEHANDLE hDev, int nUnit);
  3792. typedef int (POSSDKCALL_MODE *pPrintDensity)(DEVICEHANDLE hDev, int nDensity);
  3793. typedef int (POSSDKCALL_MODE *pMotionUnit)(DEVICEHANDLE hDev, int nHorizontalMU, int nVerticalMU);
  3794. typedef int (POSSDKCALL_MODE *pSelectPaperType)(DEVICEHANDLE hDev, int nPaperType);
  3795. typedef int (POSSDKCALL_MODE *pSelectPaperTypeEEP)(DEVICEHANDLE hDev, int nPaperType);
  3796. typedef int (POSSDKCALL_MODE *pBasicSetReserveFunction)(DEVICEHANDLE hDev, int nInstructionName, int nPara1, char *szPara2);
  3797. /// 查询
  3798. typedef int (POSSDKCALL_MODE *pRealTimeQueryStatus)(DEVICEHANDLE hDev, char *szStatus, int nDataLength, unsigned long *nRealDataLength);
  3799. typedef int (POSSDKCALL_MODE *pNonRealTimeQueryStatus)(DEVICEHANDLE hDev, char *szStatus, int nDataLength, unsigned long *nRealDataLength);
  3800. typedef int (POSSDKCALL_MODE *pAutoQueryStatus)(DEVICEHANDLE hDev, char *szStatus, int nDataLength, int nEnable, unsigned long *nRealDataLength);
  3801. typedef int (POSSDKCALL_MODE *pFirmwareVersion)(DEVICEHANDLE hDev, char *szFirmwareVersion, int nDataLength, unsigned long *nRealDataLength);
  3802. typedef int (POSSDKCALL_MODE *pSoftwareVersion)(DEVICEHANDLE hDev, char *szSoftwareVersion, int nDataLength, unsigned long *nRealDataLength);
  3803. typedef int (POSSDKCALL_MODE *pVendorInformation)(DEVICEHANDLE hDev, char *szVendorInformation, int nDataLength, unsigned long *nRealDataLength);
  3804. typedef int (POSSDKCALL_MODE *pPrinterName)(DEVICEHANDLE hDev, char *szPrinterName, int nDataLength, unsigned long *nRealDataLength);
  3805. typedef int (POSSDKCALL_MODE *pResolutionRatio)(DEVICEHANDLE hDev, char *szResolutionRatio, int nDataLength, unsigned long *nRealDataLength);
  3806. typedef int (POSSDKCALL_MODE *pHardwareSerialNumber)(DEVICEHANDLE hDev, char *szHardwareSerialNumber, int nDataLength, unsigned long *nRealDataLength);
  3807. typedef int (POSSDKCALL_MODE *pQueryReserveFunction)(DEVICEHANDLE hDev, int nInstructionsName, int nPara, char *szPara, unsigned long *nRealDataLength);
  3808. /// 日志
  3809. typedef int (POSSDKCALL_MODE *pInstructionsRecord)(DEVICEHANDLE hDev, char *szFileName, char *szFilePath, int nOpen);