I try to add button in POS screen to print a simple HTML code
And I use this code for this,
async _printWeb(receipt) {
try {
const receiptContainer = $(this.el).find('.pos-cash-rpt-container');
receiptContainer.empty();
receiptContainer.html(receipt);
await new Promise((resolve) => setTimeout(resolve, 100));
window.print();
} catch (_err) {
await this.showPopup('ErrorPopup', {
title: this.env._t('Printing is not supported on some browsers'),
body: this.env._t(
'Printing is not supported on some browsers due to no default printing protocol ' +
'is available. It is possible to print your tickets by making use of an IoT Box.'
),
});
}
I check every thing and it's ok but the print preview every time came empty
can any one help me in this