spacer
Yehuda Shiran October 1, 2001
Hiding Pages in A Print Template
Tips: October 2001

Yehuda Shiran, Ph.D.
Doc JavaScript

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

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, 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