ipos-printer
v1.2.1
Published
Capacitor plugin for Q2i PDA printer
Maintainers
Readme
ipos-printer
Plugin for Q2i PDA printer
Install
npm install ipos-printer
npx cap syncAPI
getPrinterStatus()getPrinterStatusMessage(...)setPrinterPrintDepth(...)setPrinterPrintFontType(...)setPrinterPrintFontSize(...)setPrinterPrintAlignment(...)printBlankLines(...)printText(...)printSpecifiedTypeText(...)PrintSpecFormatText(...)printColumnsText(...)printBitmap(...)printBarCode(...)printQRCode(...)printRawData(...)printRowBlock()
getPrinterStatus()
getPrinterStatus() => Promise<{ result: number; }>Get the printer status.
Returns: Promise<{ result: number; }>
getPrinterStatusMessage(...)
getPrinterStatusMessage(options: { status: number; }) => Promise<{ result: string; }>Get the printer status message.
| Param | Type | Description |
| ------------- | -------------------------------- | ------------------------------ |
| options | { status: number; } | Object containing status value |
Returns: Promise<{ result: string; }>
setPrinterPrintDepth(...)
setPrinterPrintDepth(options: { depth: number; }) => Promise<{ result: string; }>Sets the print font type, which has an effect on subsequent printing, unless initialized.
| Param | Type | Description |
| ------------- | ------------------------------- | ----------------------------- |
| options | { depth: number; } | Object containing depth value |
Returns: Promise<{ result: string; }>
setPrinterPrintFontType(...)
setPrinterPrintFontType(options: { typeface: string; }) => Promise<{ result: string; }>Sets the print font type, which has an effect on subsequent printing, unless initialized. (Currently, only one font ST is supported, and more fonts will be supported in the future).
| Param | Type | Description |
| ------------- | ---------------------------------- | -------------------------------- |
| options | { typeface: string; } | Object containing typeface value |
Returns: Promise<{ result: string; }>
setPrinterPrintFontSize(...)
setPrinterPrintFontSize(options: { fontSize: number; }) => Promise<{ result: string; }>Sets the print font size, which has an effect on subsequent printing, unless initialized. Currently, the font size is 16, 24, 32, and 48, and the default value of 24 is executed if the invalid size is entered
| Param | Type | Description |
| ------------- | ---------------------------------- | -------------------------------- |
| options | { fontSize: number; } | Object containing fontSize value |
Returns: Promise<{ result: string; }>
setPrinterPrintAlignment(...)
setPrinterPrintAlignment(options: { alignment: number; }) => Promise<{ result: string; }>Sets the print alignment, which has an effect on subsequent printing, unless initialized.
| Param | Type | Description |
| ------------- | ----------------------------------- | --------------------------------- |
| options | { alignment: number; } | Object containing alignment value |
Returns: Promise<{ result: string; }>
printBlankLines(...)
printBlankLines(options: { lines: number; height: number; }) => Promise<{ result: string; }>Printing blank lines (forced line wrapping, printing blank lines after the previous print, and all the data transferred to the printer is 0x00).
| Param | Type | Description |
| ------------- | ----------------------------------------------- | ------------------------------------------- |
| options | { lines: number; height: number; } | Object containing lines quantity and height |
Returns: Promise<{ result: string; }>
printText(...)
printText(options: { text: string; }) => Promise<{ result: string; }>Print a text.
| Param | Type | Description |
| ------------- | ------------------------------ | ---------------------------- |
| options | { text: string; } | Object containing text value |
Returns: Promise<{ result: string; }>
printSpecifiedTypeText(...)
printSpecifiedTypeText(options: { text: string; typeface: string; fontSize: number; }) => Promise<{ result: string; }>Print a text with specified type.
| Param | Type | Description |
| ------------- | ------------------------------------------------------------------ | ---------------------------------------------------- |
| options | { text: string; typeface: string; fontSize: number; } | Object containing text, typeface and fontSize values |
Returns: Promise<{ result: string; }>
PrintSpecFormatText(...)
PrintSpecFormatText(options: { text: string; typeface: string; fontSize: number; alignment: number; }) => Promise<{ result: string; }>Print a text with specified format.
| Param | Type | Description |
| ------------- | ------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| options | { text: string; typeface: string; fontSize: number; alignment: number; } | Object containing text, typeface, fontSize and alignment values |
Returns: Promise<{ result: string; }>
printColumnsText(...)
printColumnsText(options: { colsTextArr: string[]; colsWidthArr: number[]; colsAlignArr: number[]; isContinuousPrint: number; }) => Promise<{ result: string; }>Print a text with specified columns.
| Param | Type | Description |
| ------------- | ------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- |
| options | { colsTextArr: string[]; colsWidthArr: number[]; colsAlignArr: number[]; isContinuousPrint: number; } | Object containing colsTextArr, colsWidthArr, colsAlignArr and isContinuousPrint values |
Returns: Promise<{ result: string; }>
printBitmap(...)
printBitmap(options: { alignment: number; bitmapSize: number; base64: string; }) => Promise<{ result: string; }>Print a picture.
| Param | Type | Description |
| ------------- | ----------------------------------------------------------------------- | --------------------------------------------------------- |
| options | { alignment: number; bitmapSize: number; base64: string; } | Object containing alignment, bitmapSize and base64 values |
Returns: Promise<{ result: string; }>
printBarCode(...)
printBarCode(options: { data: string; symbology: number; height: number; width: number; textPosition: number; }) => Promise<{ result: string; }>Print a barcode.
| Param | Type | Description |
| ------------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------ |
| options | { data: string; symbology: number; height: number; width: number; textPosition: number; } | Object containing data, symbology, height, width and textPosition values |
Returns: Promise<{ result: string; }>
printQRCode(...)
printQRCode(options: { data: string; moduleSize: number; errorCorrectionLevel: number; }) => Promise<{ result: string; }>Print a QR code.
| Param | Type | Description |
| ------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| options | { data: string; moduleSize: number; errorCorrectionLevel: number; } | Object containing data, moduleSize and errorCorrectionLevel values |
Returns: Promise<{ result: string; }>
printRawData(...)
printRawData(options: { data: string; }) => Promise<{ result: string; }>Print the raw byte data.
| Param | Type | Description |
| ------------- | ------------------------------ | ---------------------------- |
| options | { data: string; } | Object containing data value |
Returns: Promise<{ result: string; }>
printRowBlock()
printRowBlock() => Promise<{ result: string; }>Print a row block.
Returns: Promise<{ result: string; }>
