spacer
Yehuda Shiran October 1, 2001
Hiding Pages in A Print Template
Tips: October 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

When you let your users change the page setup and print settings after the document has been edited for printing, you may end up with unneeded pages. Your original layout required 5 pages, for example, but now the user changes the paper size to a larger one, and the document requires only 4 pages. What do you do with the extra page? Never destroy it. You should not destroy LAYOUTRECTS once they have been created. Hide them instead. A good way to hide LAYOUTRECTS is to move them off the screen by using absolute positioning. You can define, for example, the style class for the DEVICERECT elements to include the left property of -50in. This property is ignored when the position property is unset or set to "static." In this case the pages always start at (0,0). When it is set to "absolute" on a DEVICERECT element, the page for that DEVICERECT element will shift to -50 inches, which is outside the screen area.

To learn more about print templates, read Column 89 (Print Templates, Part I), Column 91 (Print Templates, Part II: TemplatePrinter), Column 92 (Print Templates, Part III: HeaderFooter), and Column 93 (Print Templates, Part IV: User Settings). 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