getPageMarginTop method

Returns size of top margin from a specified @page rule and page dimensions.

Internet Explorer 8

 

Syntax

var retval = TemplatePrinter.getPageMarginTop(pageRule, pageWidth, pageHeight);

Parameters

pageRule [in]
C++Object pointer that specifies an IHTMLStyleSheetPage rule.
JScriptObject pointer that specifies an @page rule.
pageWidth [in]

Type: LONG

The page box width, in 1000ths of an inch.

pageHeight [in]

Type: LONG

The page box height, in 1000ths of an inch.

Return value

Type: Variant

The margin, in 1000ths of an inch, or null if the margin is not specified.

Remarks

getPageMarginRight was introduced in Windows Internet Explorer 8.

If the page orientation is landscape, the pageWidth and pageHeight should be reversed. For example, the following script correctly sets the page box dimensions.


if (Printer.orientation == "portrait")
{
    pageBoxWidth  = Printer.pageWidth  * 10;
    pageBoxHeight = Printer.pageHeight * 10;
}
else
{
    pageBoxWidth  = Printer.pageHeight * 10;
    pageBoxHeight = Printer.pageWidth  * 10;
}


See also

TemplatePrinter
pages

 

 

Show: