spacer
Yehuda Shiran September 13, 2001
Setting A DEVICERECT Element
Tips: September 2001

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

A DEVICERECT element represents a page to be printed or previewed. It usually contains a LAYOUTRECT element for each page, but it also can include elements such as DIV, P, UL, and IMG. These elements can be used to prepare what's called a "boilerplate": a common signature for all pages such as a copyright notice or a logo. All content to be printed or previewed must be included in a DEVICERECT element. A DEVICERECT element must include a style that defines the template's width, height, border, background, and margin. You can get the page width and height through TEMPLATEPRINTER's pageWidth and pageHeight. The only property that can be assigned in script for DEVICERECT is MEDIA (all upper case). When set to "print", pages render at the highest possible resolution. The DEVICERECT element supports the attributes MEDIA (for resolution), ID, and CLASS (for style).

To learn more about print templates, read Column 89 (Print Templates, Part I) and Column 91 (Print Templates, Part II: TemplatePrinter.) Download the Microsoft print template loader.


People who read this tip also read these tips:

Look for similar tips by subject:


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Search Engine Optimization: Selecting and Embedding Keywords · Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
IBM DB2 10 for z/OS: Justifying the Upgrade · Living La Vida Colo: Choosing the Right Colocation Facility · FTC Concerns over Social Media Privacy Linger