I'd like to ask if there's an option to print(send to printer) in js some part of website with css styles ?
I've created code:
let print_area = window.open();
print_area.document.write(print_div.innerHTML);
print_area.document.close();
print_area.focus();
print_area.print();
print_area.close();
it prints exactly what I want, but I have no css styles there(but I've created media print)
my project on jsfiddle: https://jsfiddle.net/z58pr1fL/
I advice to create a css file for printer and insert this:
Inside this
print.csssubtract lots of colors as you can. Just for save inks in your users :)Keep only border of your elements and texts with the shades of grey.
You could create a button for send to user's printer like this:
or the best way is
printer.js
If you not convince, try
window.print()in your console.