@ionic-native/star-prnt > "index.d" > StarPRNT
name: StarPRNT
description: * Ionic Native wrappers for the starprnt cordova plugin for Star Micronics Bluetooth/LAN printers
usage: import { StarPRNT } from '@ionic-native/star-prnt';
constructor(private starprnt: StarPRNT) { }
...
this.starprnt.portDiscovery('all')
.then((res: any) => console.log(res))
.catch((error: any) => console.error(error));
IonicNativePlugin
↳ StarPRNT
- AlignmentPosition
- BarcodeSymbology
- BarcodeWidth
- BitmapConverterRotation
- BlackMarkType
- CodePageType
- CutPaperAction
- Emulation
- Encoding
- FontStyleType
- InternationalType
- LogoSize
- QrCodeLevel
- QrCodeModel
- install
- platforms
- plugin
- pluginName
- pluginRef
- repo
- checkStatus
- connect
- disconnect
- getStatus
- openCashDrawer
- portDiscovery
- printImage
- printRasterReceipt
- printRawText
- getPlugin
- getPluginInstallName
- getPluginName
- getPluginRef
- getSupportedPlatforms
- installed
● AlignmentPosition: object
Defined in index.d.ts:690
Constant for possible AlignmentPosition
Center: string
Left: string
Right: string
● BarcodeSymbology: object
Defined in index.d.ts:707
Constant for possible BarcodeSymbology
Code128: string
Code39: string
Code93: string
ITF: string
JAN13: string
JAN8: string
NW7: string
UPCA: string
UPCE: string
● BarcodeWidth: object
Defined in index.d.ts:721
Constant for possible BarcodeWidth
Mode1: string
Mode2: string
Mode3: string
Mode4: string
Mode5: string
Mode6: string
Mode7: string
Mode8: string
Mode9: string
● BitmapConverterRotation: object
Defined in index.d.ts:751
Constant for possible BitmapConverterRotation
Left90: string
Normal: string
Right90: string
Rotate180: string
● BlackMarkType: object
Defined in index.d.ts:682
Constant for possible BlackMarkType
Invalid: string
Valid: string
ValidWithDetection: string
● CodePageType: object
Defined in index.d.ts:601
CodePageType constants
Blank: string
CP1001: string
CP1250: string
CP1251: string
CP1252: string
CP2001: string
CP3001: string
CP3002: string
CP3011: string
CP3012: string
CP3021: string
CP3041: string
CP3840: string
CP3841: string
CP3843: string
CP3845: string
CP3846: string
CP3847: string
CP3848: string
CP737: string
CP772: string
CP774: string
CP851: string
CP852: string
CP855: string
CP857: string
CP858: string
CP860: string
CP861: string
CP862: string
CP863: string
CP864: string
CP865: string
CP869: string
CP874: string
CP928: string
CP932: string
CP999: string
UTF8: string
● CutPaperAction: object
Defined in index.d.ts:673
Constant for possible CutPaperAction
FullCut: string
FullCutWithFeed: string
PartialCut: string
PartialCutWithFeed: string
● Emulation: object
Defined in index.d.ts:577
Constant for Emulation
EscPos: string
EscPosMobile: string
StarDotImpact: string
StarGraphic: string
StarLine: string
StarPRNT: string
StarPRNTL: string
● Encoding: object
Defined in index.d.ts:589
Constant for possible Encoding
Big5: string
GB2312: string
ShiftJIS: string
USASCII: string
UTF8: string
Windows1251: string
Windows1252: string
● FontStyleType: object
Defined in index.d.ts:666
Constant for possible FontStyleType
A: string
B: string
● InternationalType: object
Defined in index.d.ts:645
Constant for possible InternationalType
Denmark: string
Denmark2: string
France: string
Germany: string
Ireland: string
Italy: string
Japan: string
Korea: string
LatinAmerica: string
Legal: string
Norway: string
Spain: string
Spain2: string
Sweden: string
UK: string
USA: string
● LogoSize: object
Defined in index.d.ts:698
Constant for possible LogoSize
DoubleHeight: string
DoubleWidth: string
DoubleWidthDoubleHeight: string
Normal: string
● QrCodeLevel: object
Defined in index.d.ts:742
Constant for possible QrCodeLevel
H: string
L: string
M: string
Q: string
● QrCodeModel: object
Defined in index.d.ts:735
Constant for possible QrCodeModel
No1: string
No2: string
● install: string
Inherited from IonicNativePlugin.install
Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:7
● platforms: string
[]
Inherited from IonicNativePlugin.platforms
Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:6
● plugin: string
Inherited from IonicNativePlugin.plugin
Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:4
● pluginName: string
Inherited from IonicNativePlugin.pluginName
Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:2
● pluginRef: string
Inherited from IonicNativePlugin.pluginRef
Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:3
● repo: string
Inherited from IonicNativePlugin.repo
Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:5
▸ checkStatus(port: string
, emulation: string
): Promise
.<PrinterStatus>
Defined in index.d.ts:769
Checks the status of the printer
Parameters:
Param | Type | Description |
---|---|---|
port | string |
Printer name i.e BT:StarMicronics |
emulation | string |
StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact" |
Returns: Promise
.<PrinterStatus>
Returns a promise that resolves with the PrinterStatus object
▸ connect(port: string
, emulation: string
): Observable
.<any
>
Defined in index.d.ts:815
Allows you to connect to the printer, keep the connection alive and receive status updates through an observable
Parameters:
Param | Type | Description |
---|---|---|
port | string |
printer name i.e BT:StarMicronics. |
emulation | string |
StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact" |
Returns: Observable
.<any
>
Success! if connected or error message string returned by the SDK.
▸ disconnect(): Promise
.<any
>
Defined in index.d.ts:826
Allows to disconnect (close the connection to the peripherals), this is useful to avoid keeping alive a connection when not in the app to save device battery (energy consumption). You should call this function when the app is paused or closed.
Returns: Promise
.<any
>
Success! if connected or error message string returned by the SDK.
▸ getStatus(): Observable
.<any
>
Defined in index.d.ts:820
Returns an observable with the device status events. Only fires when a printer is connnected through the connect() function
Returns: Observable
.<any
>
dataType: printerOnline, printerOffline, printerImpossible, printerPaperEmpty, printerPaperNearEmpty, printerPaperReady, printerCoverOpen, printerCoverClose, cashDrawerOpen, cashDrawerClose
▸ openCashDrawer(port: string
, emulation: string
): Promise
.<any
>
Defined in index.d.ts:800
sends an appendPeripheral command to the printer for channels No1 and No2
Parameters:
Param | Type | Description |
---|---|---|
port | string |
Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function |
emulation | string |
StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact" |
Returns: Promise
.<any
>
Success! if opened or error message string returned by the SDK.
▸ portDiscovery(type: string
): Promise
.<Printers>
Defined in index.d.ts:762
Find available printers
Parameters:
Param | Type | Description |
---|---|---|
type | string |
Interface Type: All, LAN, Bluetooth, USB |
Returns: Promise
.<Printers>
Returns a promise that resolves with an array of printers
▸ print(port: string
, emulation: string
, commandsArray: CommandsArray): Promise
.<any
>
Defined in index.d.ts:808
Sends an Array of commands to the command buffer using the Android ICommandBuilderInterface or iOS ISCBBuilderInterface
Parameters:
Param | Type | Description |
---|---|---|
port | string |
Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function |
emulation | string |
StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact" |
commandsArray | CommandsArray | each command in the array should be an instance of the PrintCommand object. Example [{append:"text"}, {"openCashDrawer: 1"}] |
Returns: Promise
.<any
>
Success! if printed correctly or error message string returned by the SDK.
▸ printImage(port: string
, emulation: string
, imageObj: ImageObj): Promise
.<any
>
Defined in index.d.ts:793
Gets an image from a string URI and converts it to bitmap to send it to the printer
Parameters:
Param | Type | Description |
---|---|---|
port | string |
Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function |
emulation | string |
StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact" |
imageObj | ImageObj | uri:string, paperWidth?:number, cutReceipt?:boolean, openCashDrawer?:boolean |
Returns: Promise
.<any
>
Success! if printed correctly or error message string returned by the SDK.
▸ printRasterReceipt(port: string
, emulation: string
, rasterObj: RasterObj): Promise
.<any
>
Defined in index.d.ts:785
Converts the text into a bitmap image and sends it to the printer
Parameters:
Param | Type | Description |
---|---|---|
port | string |
Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function |
emulation | string |
StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact" |
rasterObj | RasterObj | text:string, cutReceipt?:boolean, openCashDrawer?:boolean, fontSize:number, paperWidth:number |
Returns: Promise
.<any
>
Success! if printed correctly or error message string returned by the SDK.
▸ printRawText(port: string
, emulation: string
, printObj: PrintObj): Promise
.<any
>
Defined in index.d.ts:777
Prints plain text
Parameters:
Param | Type | Description |
---|---|---|
port | string |
Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function |
emulation | string |
StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact" |
printObj | PrintObj | text:string, cutReceipt?:boolean, openCashDrawer?:boolean |
Returns: Promise
.<any
>
Success! if printed correctly or error message string returned by the SDK.
▸ getPlugin(): any
Inherited from IonicNativePlugin.getPlugin
Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:16
Returns the original plugin object
Returns: any
▸ getPluginInstallName(): string
Inherited from IonicNativePlugin.getPluginInstallName
Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:28
Returns the plugin's install name
Returns: string
▸ getPluginName(): string
Inherited from IonicNativePlugin.getPluginName
Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:20
Returns the plugin's name
Returns: string
▸ getPluginRef(): string
Inherited from IonicNativePlugin.getPluginRef
Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:24
Returns the plugin's reference
Returns: string
▸ getSupportedPlatforms(): string
[]
Inherited from IonicNativePlugin.getSupportedPlatforms
Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:32
Returns the plugin's supported platforms
Returns: string
[]
▸ installed(): boolean
Inherited from IonicNativePlugin.installed
Defined in /Users/rcasas/Desktop/cordovaplugins/StarprnDemoIonicV2/node_modules/@ionic-native/core/ionic-native-plugin.d.ts:12
Returns a boolean that indicates whether the plugin is installed
Returns: boolean