Print Templates, Part IV: User's Settings - Doc JavaScript | WebReference

Print Templates, Part IV: User's Settings - Doc JavaScript


Print Templates, Part IV: User's Settings

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 this column we draw your attention to the way you can use the Page Setup and Print Dialog settings to format the document for printing. In previous columns of this series we used default style definitions to format the document (e.g. page width, top margin, right margin, and background color.) In this column we'll show you how to overwrite the default definitions with the user's settings. The user can set his preferences in either the Page Setup dialog box, or the Print Dialog box. 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, 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 usage of the user's settings with template6.

In this column you will learn:

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

Next: How to write the print template template6.html

http://www.internet.com


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

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