npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cordova-plugin-iposprinter

v1.0.2

Published

Cordova wrapper for iPosPrinter Service

Downloads

6

Readme

Cordova Plugin for IPosPrinter Service

npm version npm downloads

Install

Cordova

$ cordova plugin add cordova-plugin-iposprinter

Ionic

$ ionic cordova plugin add cordova-plugin-iposprinter

Capacitor

$ npm install cordova-plugin-iposprinter
$ npx cap sync

Functions

getPrinterStatus()

Printer status query

printerInit()

Printer initialization Power on the printer and initialize the default settings Please check the printer status when using, please wait when PRINTER_IS_BUSY

setPrinterPrintDepth(depth)

Set the print density of the printer, which will affect subsequent printing, unless initialized

| Param | Type | Description | | --- | --- | --- | | depth | number | Concentration level, range 1-10, this function will not be executed if the range is exceeded Default level 6 |

setPrinterPrintFontType(typeface)

Set the print font type, which will affect subsequent printing, unless initialized (Currently only one font ST is supported, more font support will be provided in the future)

| Param | Type | Description | | --- | --- | --- | | typeface | string | Font name ST |

setPrinterPrintFontSize(fontsize)

Set the font size, which will affect subsequent printing, unless initialized Note: The font size is a printing method that exceeds the standard international directives. Adjusting the font size will affect the character width, and the number of characters per line will also change accordingly. Therefore, the typesetting formed in monospaced fonts may be messy and needs to be adjusted by yourself

| Param | Type | Description | | --- | --- | --- | | fontsize | number | Font size, currently supported sizes are 16, 24, 32, 48, input illegal size executes the default value 24 |

setPrinterPrintAlignment(alignment)

Set the alignment, which will affect subsequent printing, unless initialized

| Param | Type | Description | | --- | --- | --- | | alignment | number | Alignment 0: Left, 1: Center, 2: Right, Center by default |

printerFeedLines(lines)

Printer paper feed (forced line feed, paper feed lines after finishing the previous printing content, at this time the motor runs idling to feed paper, no data is sent to the printer)

| Param | Type | Description | | --- | --- | --- | | lines | number | The number of printer paper lines (each line is a pixel) |

printBlankLines(lines, height)

Print blank lines (Forced to wrap, print blank lines after finishing the previous print content, the data sent to the printer at this time are all 0x00)

| Param | Type | Default | Description | | --- | --- | --- | --- | | lines | number | | Print the number of blank lines, limit up to 100 lines | | height | number | 1 | The height of the blank line (unit: pixel) |

printText(text)

Print text The text width is full of one line and automatically wrap and typesetting

| Param | Type | Description | | --- | --- | --- | | text | string | Text string to be printed |

printSpecifiedTypeText(text, typeface, fontsize)

Print the specified font type and size text, the font setting is only valid for this time The text width is full of one line and automatically wrap

| Param | Type | Default | Description | | --- | --- | --- | --- | | text | string | | Text string to be printed | | typeface | string | "ST" | Font name ST (currently only supports one type) | | fontsize | number | 24 | Font size, currently supported sizes are 16, 24, 32, 48, input illegal size executes the default value 24 |

printSpecFormatText(text, typeface, fontsize, alignment)

Print the specified font type and size text, the font setting is only valid for this time The text width is full of one line and automatically wrap and typesetting

| Param | Type | Default | Description | | --- | --- | --- | --- | | text | string | | Text string to be printed | | typeface | string | "ST" | Font name ST (currently only supports one type) | | fontsize | number | 24 | Font size, currently supported sizes are 16, 24, 32, 48, input illegal size executes the default value 24 | | alignment | number | 0 | Alignment (0 to the left, 1 to the center, 2 to the right) |

printColumnsText(colsTextArr, colsWidthArr, colsAlign, isContinuousPrint)

Print a row of the table, you can specify the column width and alignment

| Param | Type | Description | | --- | --- | --- | | colsTextArr | Array.<string> | Array of text strings for each column | | colsWidthArr | Array.<number> | The total width of each column width array cannot be greater than ((384 / fontsize) << 1)-(number of columns + 1) (Calculated in English characters, each Chinese character occupies two English characters, and each width is greater than 0), | | colsAlign | Array.<number> | Alignment of each column (0 to the left, 1 to the center, 2 to the right) | | isContinuousPrint | Array.<number> | Whether to continue printing the form 1: Continue printing 0: Do not continue printing Remarks: The length of the array of the three parameters should be the same, if the width of colsTextArr[i] is greater than colsWidthArr[i], the text will wrap |

printBitmap(alignment, bitmapSize, mBitmap)

Print picture

| Param | Type | Default | Description | | --- | --- | --- | --- | | alignment | number | 1 | Alignment 0: Left, 1: Center, 2: Right, Center by default | | bitmapSize | number | 10 | Bitmap size, the input size range is 1~16, 10 is selected by default when the range is exceeded Unit: 24bit | | mBitmap | Array.<number> | Array.<string> | | Picture bitmap object (maximum width 384 pixels, unable to print and call back abnormal callback function) |

printBarCode(data:, symbology, height, width, textposition)

Print one-dimensional barcode

| Param | Type | Description | | --- | --- | --- | | data: | string | Barcode data | | symbology | number | Barcode type 0 -- UPC-A, 1 -- UPC-E, 2 -- JAN13(EAN13), 3 -- JAN8(EAN8), 4 -- CODE39, 5 -- ITF, 6 -- CODABAR, 7 -- CODE93, 8 -- CODE128 | | height | number | Bar code height, the value ranges from 1 to 16, the default value is 6 if it exceeds the range, each unit represents the height of 24 pixels | | width | number | Barcode width, the value ranges from 1 to 16, the default value is 12 if it exceeds the range, each unit represents the length of 24 pixels | | textposition | number | Text position 0: Do not print the text, 1: The text is above the bar code, 2: The text is below the bar code, 3: Both the top and bottom of the bar code are printed |

printQRCode(data, modulesize, mErrorCorrectionLevel:)

Print 2D barcode

| Param | Type | Default | Description | | --- | --- | --- | --- | | data | string | | QR code data | | modulesize | number | 10 | Two-dimensional code block size (unit: point, value 1 to 16), beyond the setting range, the default value is 10 | | mErrorCorrectionLevel: | number | | Two-dimensional error correction level (0:L 1:M 2:Q 3:H) |

printRawData(rawPrintData)

Print raw byte data

| Param | Type | Description | | --- | --- | --- | | rawPrintData | Array.<string> | Array.<number> | Byte Data block |

sendUserCMDData(data)

Use ESC/POS command to print

| Param | Type | Description | | --- | --- | --- | | data | Array.<string> | Array.<number> | Instructions |

printerPerformPrint(feedlines)

Perform printing After executing each printing function method, you need to execute this method before the printer can execute printing; Before executing this method, it is necessary to determine the status of the printer. This method is valid when the printer is in PRINTER_NORMAL, otherwise it will not be executed.

| Param | Type | Default | Description | | --- | --- | --- | --- | | feedlines | number | 150 | Print and feed paper feed |