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

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Google Going Native With Chrome
Mozilla Fixes Firefox Flaws as 3.5 Release Nears
Microsoft and Novell Still Bosom Buddies

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, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
XML and PHP Simplified · Creating a ASP.NET Contact Form · Data Filtering with PHP
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Intel to Host Live Nehalem Q&A · 12 Tips to Troubleshoot Network File-Sharing · 10 Tips for Selling on Kijiji