electron-pos-printer icon indicating copy to clipboard operation
electron-pos-printer copied to clipboard

Possibilty of print specific div element

Open jft-id opened this issue 3 years ago • 0 comments

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: Captura de pantalla 2021-05-01 a la(s) 01 26 55

Thanks for your help.

jft-id avatar May 01 '21 06:05 jft-id