Forum Moderators: open
I am trying to create a text link on my website that allows the user to print a 'printer friendly' version of the page.
I have found the code
a href="javascript:window.print">Print this page</a>
but it only prints the current page.
Is there a way to target another page (the preformatted version) and print it without opening it first?
Something to watch out for: if you have any reverse color effects -- light print on a coloured background for a pullquote, for example -- if the person has their printer set to ignore background colours (to save ink) the light print might be unreadable. CSS can let you change what colour things will be if the page is printed, to make sure everything is readable.
Site maintenance is easier when you use CSS to make existing pages printer-friendly, because you don't have to create or maintain any extra pages just for printing.
I think I will just have to opt for the open a new window, and have a print link on that page. I am too lazy to create a style sheet at the moment. It is something to incorporate in the future though.
Thanks again
themoron :@)
<frameset rows="100%,*">
<frame src="controlpage.html">
<frame src="printpage.html">
</frameset>
Put this in your control page:
<script language="JavaScript">
<!--
if (window.print)document.write('<form><input type="button" value="Print" onClick="parent.frames[1].focus();parent.frames[1].print()"><\/form>');
//-->
</script>
Hope this helps! ;)
I think that might just work
themoron :@)