Let's say you have a form that you want the visitor to fill out and fax back to you but you don't want to print your web page with all of the banners and buttons and only want a clean form. Or you want to have the visitor be able to print your page content without losing the right margin of the page.
Step 1:
Create a separate printer friendly page to hold the content you wish your site visitor to be able to print
Set this new printer friendly page to zero margins and to wrap to browser width
Place what you wish to have printed on this page
Step 2:
You will now add code that will redirect the browser file > print menu choice and the browser Print Icon as well as any print buttons you have on your page to print an alternate page by entering this < link > tag inside of your head tags. You only want this on one page and you do that by pressing the HTML button on the Layout Properties Palette (press F9 to bring up the layout properties palette) and entering the code in the Between Head Tags tab
< link rel="alternate" media="print" href="http://www.site.com/folder/PrinterPage.html" >
Change the URL in this example to the actual URL of the printer friendly page you created to hold the printable content.
You can then place a print button on your primary page by using the form button tool and entering something like Print this Form and Fax it to us or Print this Page in the text area and selecting Button from the type drop down.
Click the HTML button on the form button properties palette and enter onClick="window.print()
When ever this print button or the browser print icon or the browser file > print menu selection is choosen the alternate page you created will print out for the visitor to fill in or to view on paper.
Did you find this tutorial useful? Do you want to keep this resource online? Make a donation to keep gotFusion alive
This page was written by and is maintained by turtle
|
|