spacer
Yehuda Shiran September 10, 2001
Controlling Selective Printing
Tips: September 2001

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

The TemplatePrinter element supports selective printing. You can choose from within JavaScript if you want to print a selected portion of the document. If the TemplatePrinter's ID is printer, you would turn on selective printing by going:

printer.selectedPages = true;
Set selectedPages to false to print all pages. You can set and get the first and last pages of the selection range. You can change them from within the script, or you can have them modified by the user in the print dialog window. Any user's changes are reflected in the script as well. Use printer.pageFrom to find the first selected page. Use printer.pageTo to find the last selected page. To set the first selected page to 5 and the last page to 12, you would go:

printer.pageFrom = 5;
printer.pageTo = 12;
To learn more about print templates, read Column 89 (Print Templates, Part I) and Column 91 (Print Templates, Part II: TemplatePrinter.) Download the Microsoft print template loader.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business