Page Printing Controls

Creating a Print Link:

The following code lets the user click on a link <A HREF=""> to print the page. This is useful and doesn't take up much "Real Estate" on the page. Because it is a link, it may be overlooked, however, as the Print function is not normally associated with a link.

<A HREF="Javascript:window.print();">Print This Page</A>

Print This Page


Creating a Print Link:

Instead of link text that might be mistaken for another webpage, use an IMAGE of a printer to get the message across. Simple nest the image between the <A></A> tags:

<A HREF="Javascript:window.print();">
Click to Print Page <IMG SRC="Printer.gif" BORDER="0" ALT="Click to Print Page">
</A>



Creating a Print Button:

The clearest way to provide a print control, is to provide a button with a clear label on it "Print This Page". This button could be part of a FORM, but in the case below, it is simple an input control, with the type set to "Button". Netscape doesn't like input buttons all by themselves, so to make Netscape happy, you could nest the <INPUT> inside a <FORM></FORM> tag. There is no need to set a NAME, METHOD, or ACTION for the <FORM> tag. Just the existance of the tag will make Netscape happy.

<INPUT TYPE="Button" VALUE="Print This Page" OnClick="window.print();">



Setting up a Page Break:

If you actually printed this page, you'll notice that the printed page doesn't look as good as the webpage

To do this, you need to take charge of where the page breaks. By using the paragraph tab <P>, and adding a STYLE, we can set up a hard page break. To set up LABELS, (I haven't tried this), you'd probably have to set up a series of table cells, each EXACTLY the size of one label. You'd have to text it quite a bit, and perhaps limit it to one page of labels at a time. But anything that can be seen, can be printed.

Here is the code to set up page breaks on the printed page. Page breaks have no effect in the browser. They only effect the way the page prints.

<p STYLE="page-break-before: always">
<H3 ALIGN="center">Page Two</H3>
<P>Type your paragraph here. On the printer, it will begin on a new sheet of paper</P>

Click on this example to load a new page specially formatted for printing.