spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column94


Print Templates, Part V: Re-pagination

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

In this column we continue our series on print templates. Print templates first appeared in Internet Explorer 5.5, and were later improved in Internet Explorer 6. In column 89, Print Templates, Part I, we showed you how to assemble a print template with two out of the four elements of print templates: LayoutRect and DeviceRect. In Column 91 (Print Templates, Part II: TemplatePrinter) we added the TemplatePrinter element. In Column 92 (Print Templates, Part III: HeaderFooter), we cover the fourth and last element of print templates, HeaderFooter. In Column 93, (Print Templates, Part IV: User Settings) we taught you how to reflect the user settings in the document layout. In this column, we'll explain how to re-paginate a document following a change in its zoom factor. In previous columns, we always dealt with a single static pagination, after which we ended up with a single document format. When the user can change the zoom factor, the number of pages may go up or down, and what to do with the excess pages, if there are any, is not that trivial. We'll show you how to hide unused pages from previous pagination. We'll also show you how to set the different event handlers to support such a capability. This column also combines several capabilities we have presented before, such as dynamic page assembling, printing with and without preview, adding headers and footers, updating the total number of pages in all pages, page formatting according to user settings, etc.

The only way to call TemplatePrinter and HeaderFooter is through C++ code. Luckily, someone in Microsoft wrote an application to which you can feed your own print templates and the documents you want to print. This application comes with sample print templates that our columns are based on. In this column we introduce the change in zoom factor with template7.html.

In this column you will learn:

You can see the full code listing of template7 on Page 7. Load it from the enclosed zipped file.

Next: How to write the print template

More Resources from Doc JavaScript
Columns Popular Columns Tips Tools
Latest Columns
41-50 | 31-40 | 21-30
11-20 | 1-10
Working with Windows
JavaScript and Frames
Bookmarklets
Random Tips
Personalized Tips
RSS Channels
Menu Builder
Rollover Builder
Rotation Builder
Reference Tip Categories (want one?)
Links
For Your Site
Did you learn something? Do you like this site? Please link to us!

http://www.internet.com

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


Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: October 8, 2001
Revised: October 8, 2001

URL: http://www.webreference.com/js/column94/index.html