: How to display a logo in a printed web page that doesn't appear on-screen? I have sales report I want to print with a logo, but I don't want it shown on the screen. I'm currently trying
I have sales report I want to print with a logo, but I don't want it shown on the screen.
I'm currently trying to use JavaScript to print a particular DIV from a page:
<script type="text/javascript">
function PrintDiv() {
var divToPrint = document.getElementById('divToPrint');
var popupWin = window.open('', '_blank', 'width=300,height=300');
popupWin.document.open();
popupWin.document.write('<html><body onload="window.print()">' +
divToPrint.innerHTML + '</html>');
popupWin.document.close();
}
</script>
<a href="#" onclick="PrintDiv();">Print page</a>
Is this the right method I should use so that the logo is shown only in the printed sales report?
More posts by @Murphy175
1 Comments
Sorted by latest first Latest Oldest Best
Use a print stylesheet to show the logo.
Leave the logo in your on-screen version of the report, just hide that div with your normal stylesheet.
In your print stylesheet, simply display the div with the logo.
Here's a short, snappy guide to using a print stylesheet: www.webcredible.co.uk/user-friendly-resources/css/print-stylesheet.shtml
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.