Print Templates, Part II: TemplatePrinter
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:
DeviceRect. In this column we add the
TemplatePrinter element. The
TemplatePrinter behavior supports a wealth of methods and properties. In Column 89 we showed you how to preview a document. In this column we'll show you how to invoke the printing from within the print template.
The only way to call
TemplatePrinter is through C++ code. Relax, we are not going to teach you C++ in this column. Luckily, Microsoft wrote an application that 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
TemplatePrinter with a two-page static document. We'll show you how to start a print job, how to print a page, and how to end a print job.
In this column you will learn:
- How to use Microsoft's print template loader
- How to assemble a print template with
- How to cipher
dialogArgumentsfor the desired action
- How to print a document
Next: How to use Microsoft's print template loader