{"_id":"@azarudeen-ahamed/capacitor-printer","name":"@azarudeen-ahamed/capacitor-printer","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@azarudeen-ahamed/capacitor-printer","version":"0.1.0","description":"Capacitor plugin for printing to Bluetooth, WiFi, USB and POS handheld printers with ESC/POS support","main":"dist/plugin.cjs.js","module":"dist/plugin.js","types":"dist/types/src/index.d.ts","exports":{".":{"import":"./dist/plugin.js","require":"./dist/plugin.cjs.js","types":"./dist/types/src/index.d.ts"}},"scripts":{"build":"npm run clean && rollup -c rollup.config.mjs","clean":"if exist dist rimraf dist","watch":"rollup -c rollup.config.mjs -w","prepublishOnly":"npm run build","test":"echo \"No tests yet\" && exit 0"},"keywords":["capacitor","plugin","printer","thermal","esc-pos","escpos","bluetooth","ble","wifi","usb","receipt","pos","sunmi","pax","ionic","angular"],"author":{"name":"Neolysi"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/neolysi/capacitor-printer.git"},"bugs":{"url":"https://github.com/neolysi/capacitor-printer/issues"},"homepage":"https://github.com/neolysi/capacitor-printer","typesVersions":{"*":{"*":["dist/types/src/*"]}},"peerDependencies":{"@capacitor/core":"^6.0.0 || ^7.0.0"},"devDependencies":{"@capacitor/android":"^7.0.0","@capacitor/core":"^7.0.0","@capacitor/ios":"^7.0.0","@rollup/plugin-typescript":"^12.3.0","rimraf":"^6.0.1","rollup":"^4.34.0","tslib":"^2.8.1","typescript":"^5.7.0"},"_id":"@azarudeen-ahamed/capacitor-printer@0.1.0","_nodeVersion":"25.2.1","_npmVersion":"11.14.1","dist":{"integrity":"sha512-I7oMB4IVjo5aoHz0H2ltKi4lwqSh0INvHnnT3/JIH3r2oceKlmuD+g8aXTeUsa8sn+CcgEF7qh+76yNxmVzKgw==","shasum":"4d3e1abadcac564c7a43168ad04fb2497abf896e","tarball":"https://registry.npmjs.org/@azarudeen-ahamed/capacitor-printer/-/capacitor-printer-0.1.0.tgz","fileCount":33,"unpackedSize":157088,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDzM4K+3+4LTHKmlFoqIv4T6aFE47khAxj5aBgqo5NEEgIgMrQaf3zwPugwHpBR1Ilfgiwd/jxP20b1aasZiCjI/2E="}]},"_npmUser":{"name":"azarudeen-ahamed","email":"azarudeen20@gmail.com"},"directories":{},"maintainers":[{"name":"azarudeen-ahamed","email":"azarudeen20@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/capacitor-printer_0.1.0_1778486937005_0.13311074861696892"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-11T08:08:56.317Z","0.1.0":"2026-05-11T08:08:57.175Z","modified":"2026-05-11T08:08:57.389Z"},"maintainers":[{"name":"azarudeen-ahamed","email":"azarudeen20@gmail.com"}],"description":"Capacitor plugin for printing to Bluetooth, WiFi, USB and POS handheld printers with ESC/POS support","homepage":"https://github.com/neolysi/capacitor-printer","keywords":["capacitor","plugin","printer","thermal","esc-pos","escpos","bluetooth","ble","wifi","usb","receipt","pos","sunmi","pax","ionic","angular"],"repository":{"type":"git","url":"git+https://github.com/neolysi/capacitor-printer.git"},"author":{"name":"Neolysi"},"bugs":{"url":"https://github.com/neolysi/capacitor-printer/issues"},"license":"MIT","readme":"# @azarudeen-ahamed/capacitor-printer\n\nMulti-printer Capacitor plugin for Ionic/Angular apps. Supports Bluetooth (Classic + BLE), WiFi (TCP/IP), USB, and built-in POS handheld printers (Sunmi, PAX, Newland, iMin) with full ESC/POS command support, multiple paper sizes, barcodes, QR codes, and image printing.\n\n## Features\n\n- **Multi-printer support**: Bluetooth Classic, BLE, WiFi, USB, POS handheld built-in\n- **ESC/POS encoding**: Bold, alignment, font sizes, underline, line feeds, paper cut, cash drawer\n- **Barcodes**: CODE128, EAN-13, EAN-8, UPC-A, UPC-E, CODE39, CODE93, ITF, CODABAR\n- **QR Codes**: Configurable size and error correction (L/M/Q/H)\n- **Image printing**: Base64 images, rasterized for thermal printers\n- **NV Graphics**: Store images in printer flash memory\n- **Paper sizes**: 44mm, 58mm, 76mm, 80mm (configurable characters per line)\n- **POS handheld**: Auto-detect Sunmi, PAX, Newland, iMin built-in printers\n- **Encoding**: UTF-8, GBK, CP437, CP850\n\n## Installation\n\n```bash\nnpm install @azarudeen-ahamed/capacitor-printer\nnpx cap sync\n```\n\n### Android Permissions\n\nAdd to `android/app/src/main/AndroidManifest.xml`:\n\n```xml\n<uses-permission android:name=\"android.permission.BLUETOOTH\" />\n<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\" />\n<uses-permission android:name=\"android.permission.BLUETOOTH_CONNECT\" />\n<uses-permission android:name=\"android.permission.BLUETOOTH_SCAN\" />\n<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />\n<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" />\n<uses-feature android:name=\"android.hardware.usb.host\" android:required=\"false\" />\n```\n\n### iOS Setup\n\nAdd to `ios/App/Info.plist`:\n\n```xml\n<key>NSBluetoothAlwaysUsageDescription</key>\n<string>This app uses Bluetooth to connect to printers</string>\n<key>NSBluetoothPeripheralUsageDescription</key>\n<string>This app uses Bluetooth to connect to printers</string>\n<key>UISupportedExternalAccessoryProtocols</key>\n<array>\n    <string>com.zebra.rawport</string>\n    <string>com.epson.escpos</string>\n    <string>com.bixolon.protocol</string>\n</array>\n```\n\n## Basic Usage\n\n```typescript\nimport { Printer } from '@azarudeen-ahamed/capacitor-printer';\n\n// Discover Bluetooth printers\nconst { devices } = await Printer.discoverBluetoothPrinters();\n\n// Connect to a Bluetooth printer\nawait Printer.connect({\n  type: 'bluetooth-classic',\n  address: devices[0].address,\n});\n\n// Print text\nawait Printer.printText({ text: 'Hello World', bold: true, align: 'center' });\n\n// Print a full receipt\nawait Printer.printReceipt({\n  paperSize: '80mm',\n  items: [\n    { type: 'text', text: 'NEOLYSI PMS', bold: true, align: 'center', fontSize: 2 },\n    { type: 'divider' },\n    { type: 'text', text: 'Room 101 - Checkout', bold: true },\n    { type: 'divider' },\n    { type: 'text', text: 'Room Charge       $150.00' },\n    { type: 'text', text: 'Mini Bar           $25.00' },\n    { type: 'text', text: 'Laundry            $15.00' },\n    { type: 'divider' },\n    { type: 'text', text: 'TOTAL: $190.00', bold: true, align: 'right' },\n    { type: 'barcode', barcode: { type: 'CODE128', content: 'INV-001' } },\n    { type: 'qr', qrCode: { content: 'https://neolysi.com/inv/001', size: 6 } },\n    { type: 'text', text: 'Thank you!', align: 'center' },\n  ],\n  cutPaper: true,\n});\n\n// Cut paper\nawait Printer.cutPaper();\n\n// Disconnect\nawait Printer.disconnect();\n```\n\n## Connection Types\n\n```typescript\n// Bluetooth Classic\nawait Printer.connect({ type: 'bluetooth-classic', address: '00:11:22:33:44:55' });\n\n// Bluetooth Low Energy\nawait Printer.connect({ type: 'ble', address: 'AA:BB:CC:DD:EE:FF' });\n\n// WiFi (TCP/IP)\nawait Printer.connect({ type: 'wifi', ip: '192.168.1.100', port: 9100 });\n\n// USB\nawait Printer.connect({ type: 'usb', vendorId: 1046, productId: 20482 });\n\n// Built-in POS (auto-detect Sunmi/PAX/Newland/iMin)\nawait Printer.connect({ type: 'pos-builtin' });\n```\n\n## API Reference\n\n### Discovery\n| Method | Returns | Description |\n|--------|---------|-------------|\n| `discoverBluetoothPrinters()` | `PrinterDevice[]` | List paired BT devices |\n| `discoverWifiPrinters()` | `WifiPrinterDevice[]` | Scan subnet for TCP printers |\n| `discoverUsbPrinters()` | `UsbPrinterDevice[]` | List connected USB printers |\n\n### Connection\n| Method | Description |\n|--------|-------------|\n| `connect(options)` | Connect to a printer by type |\n| `disconnect()` | Disconnect current printer |\n| `isConnected()` | Check connection status |\n| `getPosPrinterStatus()` | Get POS handheld printer info |\n\n### Printing\n| Method | Description |\n|--------|-------------|\n| `printText(options)` | Print a single line of text |\n| `printReceipt(options)` | Print a full receipt with items |\n| `printRaw(options)` | Send raw ESC/POS bytes |\n| `printImage(options)` | Print a base64 image |\n| `printBarcode(options)` | Print a barcode |\n| `printQr(options)` | Print a QR code |\n\n### Commands\n| Method | Description |\n|--------|-------------|\n| `setPaperSize(options)` | Set paper width |\n| `getPaperSize()` | Get current paper size |\n| `setBold(options)` | Toggle bold |\n| `setAlignment(options)` | Set text alignment |\n| `setTextSize(options)` | Set text size |\n| `lineFeed(options)` | Feed paper lines |\n| `cutPaper()` | Cut paper (full) |\n| `openCashDrawer()` | Open cash drawer |\n| `resetPrinter()` | Reset printer |\n| `storeNvImage(options)` | Store image in printer NV memory |\n| `printNvImage(options)` | Print stored NV image |\n\n## Paper Sizes\n\n| Key | Width | Characters | Max Dots |\n|-----|-------|-----------|----------|\n| `44mm` | 44mm | 24 | 320 |\n| `58mm` | 58mm | 32 | 384 |\n| `76mm` | 76mm | 42 | 546 |\n| `80mm` | 80mm | 48 | 576 |\n\n## Supported POS Handheld Devices\n\n- **Sunmi**: V1, V2, V2s, V2 Pro, T1, T2, D2, D2s, L2, P2, P2 Pro, SP1\n- **PAX**: A920, A80, A77, S920, S90, D180, D210\n- **Newland**: N900, N910, N950, MT90, MT65\n- **iMin**: M1, M2, M3, P1, D1, T1\n\n## Encoding Support\n\n| Encoding | Use Case |\n|----------|----------|\n| `UTF-8` | Modern printers with Unicode support |\n| `GBK` | Chinese printers (Sunmi, PAX POS) |\n| `CP437` | Legacy ESC/POS printers (default) |\n| `CP850` | Western European printers |\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-e9b53cba6b29b078966f81286a16b618"}