electron-pos-printer
electron-pos-printer copied to clipboard
Possibilty of print specific div element
I would like to know if there is a way to print a specific html div element brought it by a getElementById and use the HTML directly with the css designed for the app. I tried to use it as I say, but it prints the entire code as an array of characters.
This is part of the code I wrote it in the renderer.js file to try to bring the div content.
const posTicket = document.getElementById('printable-div); const tick = posTicket.innerHTML;
Then in the variable to set the content options I use it as this:
{ type: "text", value: [...tick], css: { "font-size": "12px", "font-family": "Helvetica", }, },
So when I see the preview it gives me this:
Thanks for your help.