53
CITIZEN UWP POS Print SDK - Programming Manual
Example
// Standard print
await printer.PrintNormalAsync( "\u001b|2vCSample 2 - Print\n");
await printer.PrintTextAsync(
"1234567890123456789012345678901234567890123456789012345678901234
567890123456789012345678901234567890\n",
ESCPOSConst.CMP_ALIGNMENT_RIGHT, ESCPOSConst.CMP_FNT_DEFAULT,
ESCPOSConst.CMP_TXT_1WIDTH | ESCPOSConst.CMP_TXT_1HEIGHT);
// Start of Page Mode
await printer. PageModePrintAsync( ESCPOSConst.CMP_PM_PAGE_MODE );
// Set offset of Page Mode
printer.SetPageModeVerticalPosition( 0 );
printer.SetPageModeHorizontalPosition( 0 );
// Set direction of Page Mode
printer.SetPageModePrintDirection( ESCPOSConst.CMP_PD_TOP_TO_BOTTOM );
// Set print area of Page Mode
printer.SetPageModePrintArea( "308,0,76,800" );
await printer.PrintNormalAsync( "\u001b|4C- Receipt -\n" );
// Set print area of Page Mode
printer.SetPageModePrintArea( "184,0,120,800" );
await printer.PrintTextAsync( " $ 299.99- \n",
ESCPOSConst.CMP_ALIGNMENT_CENTER, ESCPOSConst.CMP_FNT_UNDERLINE |
ESCPOSConst.CMP_FNT_BOLD, ESCPOSConst.CMP_TXT_4WIDTH |
ESCPOSConst.CMP_TXT_4HEIGHT );
// Set print area of Page Mode
printer.SetPageModePrintArea( "88,0,88,560" );
await printer.PrintTextAsync( "CITIZEN SYSTEMS\n",
ESCPOSConst.CMP_ALIGNMENT_RIGHT, ESCPOSConst.CMP_FNT_DEFAULT,
ESCPOSConst.CMP_TXT_2WIDTH | ESCPOSConst.CMP_TXT_3HEIGHT );
// Set print area of Page Mode
printer.SetPageModePrintArea( "0,0,88,480" );
await printer.PrintBarCodeAsync ( "123456789012",
ESCPOSConst.CMP_BCS_UPCA, 64, 4, ESCPOSConst.CMP_ALIGNMENT_LEFT,
ESCPOSConst.CMP_HRI_TEXT_BELOW );
// Set print area of Page Mode
printer.SetPageModePrintArea( "0,600,192,192" );
await printer.PrintQRCodeAsync(
"http://www.citizen-systems.co.jp/", 5,
ESCPOSConst.CMP_QRCODE_EC_LEVEL_L,
ESCPOSConst.CMP_ALIGNMENT_LEFT );
// End of Page Mode
await printer.PageModePrintAsync( ESCPOSConst.CMP_PM_NORMAL );
Print image