Good Day! I need your help for my Ionic project. How can I customize the content of the receipt in pos thermal printer via bluetooth? I want to adjust the font size, the font format and make it center and other stuff. I can print text but I don’t know how to format it.
here’s the plugin that is used https://github.com/razmans/ionicBluetoothPrint
testPrint(bluetooth_address)
{
let header = "PCG Cellphone Shop \n Plaza Burgos, Guagua, Pampanga \n (Beside Generika) \n \n Smart Padala No. \n 5577-5194-0426-6109 \n 5577-5194-0426-7109 \n 0999-3209009"
let cashierCustomerInformation = "Cashier: PCG Sakes POS \n POS: SP POS 1 \n \n Customer: Nora B. Beiza \n 09430359637"
let topTransactionInformation = "Receive - Smart Padala \t 2,000.00 \n 1 x 2,000.00 \n"
let midTransactionInformation = "1 x 2,000.00 \n 20Jan 10:19: Received P2,000.00 with P23.00 commission from 09393965558 to PCG LA.LIBRE ang pag-claim! Ref:174813715fdf Bal:P16,297.84"
let bottomTransactionInformation = "03. 1,5000.01 to 2,000 \t 0.00 \n Recieve Charge \n 1x0.00"
let totalInformation = "Total \t 2,000.00 \n Cash 2,000.00"
let footer = "\tThank you for choosing \t \n \t Smart Padala! \n 1/20/19 5:03 PM \t #1-1620"
let printData= header +cashierCustomerInformation + topTransactionInformation + midTransactionInformation
+ bottomTransactionInformation + totalInformation + footer
let xyz=this.connectBT(bluetooth_address).subscribe(data=>{
this.btSerial.write(printData).then(dataz=>{
console.log("WRITE SUCCESS",dataz);
let mno=this.alertCtrl.create({
title:"Print SUCCESS!",
buttons:['Dismiss']
});
mno.present();
xyz.unsubscribe();
},errx=>{
console.log("WRITE FAILED",errx);
let mno=this.alertCtrl.create({
title:"ERROR "+errx,
buttons:['Dismiss']
});
mno.present();
});
},err=>{
console.log("CONNECTION ERROR",err);
let mno=this.alertCtrl.create({
title:"ERROR "+err,
buttons:['Dismiss']
});
mno.present();
});
}