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

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

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 >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint