capacitor-printer
v0.0.21
Published
Use ionic framework in mobiIot to print receipt
Downloads
18
Readme
capacitor-printer
Use ionic framework capacitor in mobiIot to print receipt
Install
npm install capacitor-printer
npx cap sync
Usage
import { MobiPrint } from 'capacitor-printer';
export class PrintPage {
constructor() {}
async printClicked(){
var payload= {
"company":"COMPANY X",
"address":"P.O.BOX-XXX-XXXXX,NAKURU",
"email":"[email protected]",
"contact":"020-2336234/24732472364",
"other_info":"PIN : XXXXXXXXXX",
"cashier":"XXXXX XXXX",
"total_items":"1",
"sub_total":"340",
"vat":"20",
"total":"360",
"qrcode_link":"http://www.google.com",
"tax_perc":"18%",
"datetime":"10:30 PM JAN 04 2023",
"items":[
{
"name":"item x",
"quantity":"1",
"price":"1000.50",
"amount":"1000.50"
}],
"payments":[
{"name":"CASH","amount":"1000.50","currency":"KSH"}
]
};
var payload_str=JSON.stringify(payload);
const result = await MobiPrint.printReceipt({value:payload_str});
}
}
printReceipt(...)
printReceipt(options: { value: string; }) => Promise<{ value: string; }>
| Param | Type |
| ------------- | ------------------------------- |
| options
| { value: string; } |
Returns: Promise<{ value: string; }>