I am attempting to print a div using the following javascript
code:
var divToPrint = document.getElementById(curid);
var newTab = window.open('', 'Print-Window');
newTab.document.open();
newTab.document.write('<html><head><link rel="stylesheet" href="css/bootstrap.css"><link rel="stylesheet" href="css/font-awesome.min.css"><link rel="stylesheet" href="css/style.css"><link rel="stylesheet" type="text/css" media="print" href="css/print.css"></head><body onload="window.print()">' + divToPrint.innerHTML + '</body></html>');
newTab.document.close();
setTimeout(function () {
newTab.close();
}, 10);
Print.css content:
@media print {
font-size:10px;
font-family: Calibri;
}
The style of the printed div is as follows:
font-size:8pt;font-family: Calibri
;
The displayed div appears correctly, but when printed, the font size is 12 points according to my review in open office.
I have attempted modifying the attributes for media-print without success.