Hi,
I made a small application in CXP based on the "orders" sample to make online orders.
The application works well on Android smartphones.
But I need to print a small receipt on an 80-column thermal roll paper printer connected via BT. But it's not easy.
Does anyone have this type of solution working, who can give a tip or a small sample?
Printing directly to a printer in CXP is not easy!!
Thanks.
CXP print ticket
Re: CXP print ticket
Client-side-printing in a web application is mostly realized using Javascript. This is a sample code that prints any html-content ('el'). ChatGPT can help you with that kind of issues. Embedding Javascript in a CXP application should be easy (but I don't use it).
Code: Select all
function printContent(el) {
var restorePage = document.body.innerHTML;
var printContent = document.getElementById(el).innerHTML;
document.body.innerHTML = printContent;
window.print();
document.body.innerHTML = restorePage;
}
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: CXP print ticket
Hello Tom.
Thank you for your quick response.
I have already tried this type of printing.
It is not practical and does not work well...
What I need is a way to print the contents of an array on a 40-column form without having to constantly select the driver. You know that on Android the printer is connected via Bluetooth and the printing system is somewhat different.
What I am looking for is something different. I am investigating the possibility of printing directly to the port or something like that. Here, the applications that work in the cloud use an application installed on the smartphone that receives the packages from the website and proceeds to print.
I think that is the direction I should go, but I don't think I can do it with the CXP!!
I was hoping that someone here on this forum had some experience in this area!!
Thank you very much Tom!!
Thank you for your quick response.
I have already tried this type of printing.
It is not practical and does not work well...
What I need is a way to print the contents of an array on a 40-column form without having to constantly select the driver. You know that on Android the printer is connected via Bluetooth and the printing system is somewhat different.
What I am looking for is something different. I am investigating the possibility of printing directly to the port or something like that. Here, the applications that work in the cloud use an application installed on the smartphone that receives the packages from the website and proceeds to print.
I think that is the direction I should go, but I don't think I can do it with the CXP!!
I was hoping that someone here on this forum had some experience in this area!!
Thank you very much Tom!!
Pedro Alexandre