50
CITIZEN UWP POS Print SDK - Programming Manual
2.3.19. TransactionPrintAsync method
Syntax
Task<int> TransactionPrintAsync (int control)
Parameter
The meaning and the setting range of the parameters are as follows.
Value
[IN/OUT] Meaning
Setting range
control
[IN]
Transaction control
CMP_TP_TRANSACTION
:
Begin a transaction.
CMP_TP_NORMAL
:
End a transaction by printing the
buffered data.
Description
This method is used to start or end a transaction mode.
If control is CMP_TP_TRANSACTION, then transaction mode is entered. Subsequent methods calls will
buffer the print data. The methods applied to a transaction mode are as follows.
PrintTextAsync, PrintBitmapAsync, PrintNVBitmapAsync, PrintBarCodeAsync, PrintPDF417Async,
PrintQRCodeAsync, PrintGS1DataBarStackedAsync, CutPaperAsync, UnitFeedAsync,
OpenDrawerAsync, RotatePrintAsync, PageModePrintAsync, ClearePrintArea, PrintDataAsync,
PrintNormalAsync
If control is CMP_TP_NORMAL, then transaction mode is exited. If some data was buffered, then the
buffered data is printed. The entire transaction is treated as one message.
Calling the
cancels transaction mode. Any buffered print lines are also
cleared.
Return value
Return CMP_SUCCESS (0) in success. Please refer to "
" for the error code except it.
Example
await printer.TransactionPrintAsync( ESCPOSConst.CMP_TP_TRANSACTION );
await printer.PrintNVBitmapAsync( 1 );
await printer.PrintBarCodeAsync ( "123456789012", ESCPOSConst.CMP_BCS_UPCA,
50, 2, ESCPOSConst.CMP_ALIGNMENT_LEFT,
ESCPOSConst.CMP_HRI_TEXT_ABOVE );
await printer.PrintTextAsync( "Line 1\n", ESCPOSConst.CMP_ALIGNMENT_LEFT,
ESCPOSConst.CMP_FNT_DEFAULT, ESCPOSConst.CMP_TXT_1WIDTH );
await printer.PrintTextAsync( "Line 2\n", ESCPOSConst.CMP_ALIGNMENT_LEFT,
ESCPOSConst.CMP_FNT_DEFAULT, ESCPOSConst.CMP_TXT_1WIDTH );
await printer.PrintTextAsync( "Line 3\n", ESCPOSConst.CMP_ALIGNMENT_LEFT,
ESCPOSConst.CMP_FNT_DEFAULT, ESCPOSConst.CMP_TXT_1WIDTH );
await printer.PrintBarCodeAsync ( "123456789012", ESCPOSConst.CMP_BCS_UPCA,
50, 2, ESCPOSConst.CMP_ALIGNMENT_LEFT,
ESCPOSConst.CMP_HRI_TEXT_ABOVE );
await printer.PrintNVBitmapAsync( 1 );
await printer.CutPaperAsync( ESCPOSConst.CMP_CUT_PARTIAL_PREFEED );
await printer.TransactionPrintAsync( ESCPOSConst.CMP_TP_NORMAL );