Verdaccio
01-23-2012, 04:54 PM
Hello!
I have a script that prints a DIV and I am looking to set the font for the generated page, and the font color and size. But for the life of me, I cannot figure out if it can be done in this script, or if I have to setup a separate print.css.
Here is my script:
<script type="text/javascript">
function PrintDiv_print_all() {
var divToPrint = document.getElementById('print_all');
var popupWin = window.open('', '_blank', 'width=600,height=800,scrollbars=yes');
popupWin.document.open();
popupWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</html>');
popupWin.document.close();
}
</script>
I am still learning this stuff and any help is appreciated! :)
I have a script that prints a DIV and I am looking to set the font for the generated page, and the font color and size. But for the life of me, I cannot figure out if it can be done in this script, or if I have to setup a separate print.css.
Here is my script:
<script type="text/javascript">
function PrintDiv_print_all() {
var divToPrint = document.getElementById('print_all');
var popupWin = window.open('', '_blank', 'width=600,height=800,scrollbars=yes');
popupWin.document.open();
popupWin.document.write('<html><body onload="window.print()">' + divToPrint.innerHTML + '</html>');
popupWin.document.close();
}
</script>
I am still learning this stuff and any help is appreciated! :)