@dolosplus/zebra-capacitor
v1.0.0
Published
Zebra printer capacitor plugin library with ZSDK API
Downloads
10
Readme
zebra-capacitor
Zebra printer capacitor plugin library for iOS. Ionic Capacitor v3 wrapper with ZSDK_API. Support base64 PDF and regular Text printing.
Only tested with ZQ520 and ZQ521. Should work for all Zebra Bluetooth printers. Android is not yet supported at the moment unless someone wants to contribute to this repo. Contact me at DOLOS+
Install
npm install @dolosplus/zebra-capacitor
npx cap sync
Version History
- Release 0.0.9 (Supply Chains)
- Release 0.0.10 (LMT R2)
- Release x (CAP4)
API
connectPrinter(...)
printText(...)
printPDF(...)
addListener('printerStatusChange', ...)
- Interfaces
- Type Aliases
connectPrinter(...)
connectPrinter(options: { config: string; }) => Promise<any>
| Param | Type |
| ------------- | -------------------------------- |
| options
| { config: string; } |
Returns: Promise<any>
printText(...)
printText(options: { text: string; }) => Promise<any>
| Param | Type |
| ------------- | ------------------------------ |
| options
| { text: string; } |
Returns: Promise<any>
printPDF(...)
printPDF(options: { base64: string; size?: { x: number; y: number; width: number; height: number; }; }) => Promise<any>
| Param | Type |
| ------------- | ------------------------------------------------------------------------------------------------- |
| options
| { base64: string; size?: { x: number; y: number; width: number; height: number; }; } |
Returns: Promise<any>
addListener('printerStatusChange', ...)
addListener(eventName: 'printerStatusChange', listenerFunc: StateChangeListener) => Promise<PluginListenerHandle> & PluginListenerHandle
| Param | Type |
| ------------------ | ------------------------------------------------------------------- |
| eventName
| 'printerStatusChange' |
| listenerFunc
| StateChangeListener |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Interfaces
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove
| () => Promise<void> |
ConnectState
| Prop | Type | Description | Since |
| -------------- | -------------------- | --------------------------------- | ----- |
| isActive
| boolean | Whether the app is active or not. | 1.0.0 |
Type Aliases
StateChangeListener
(state: ConnectState): void