PeachBrackets

PeachBrackets

HtmlDocumentOptions Class

How an HtmlDocument is loaded and paginated: the size of the page, its margins, and the environment the style sheets are evaluated in.

public sealed class HtmlDocumentOptions

Inheritance System.Object → HtmlDocumentOptions

Remarks

Lengths are in points (1/72 inch); a @page rule in the document overrides the page size and margins set here. The options are read when the document is loaded, so a change afterwards does not reach a document that already exists.

Properties  
AnimationProgress How far through its animations the document is painted, from 0 (the start) to 1 (the end), or null for the document’s static look.
CollectFormFields Whether form controls are collected into FormFields so a consumer can make them interactive. Off by default; the controls are painted either way.
ColorScheme The colour scheme prefers-color-scheme media queries report. Light by default.
DefaultLanguage The language to assume when the document declares none (<html lang>), as a BCP 47 tag, or null to assume none. It drives hyphenation and language-dependent line breaking.
IgnoreAuthorStyleSheets Whether the document’s own <style> and <link rel=stylesheet> rules are ignored, leaving only the built-in defaults and UserStyleSheet. Off by default.
MarginBottomPoints The margin below the content, in points. 20 by default.
MarginLeftPoints The margin to the left of the content, in points. 20 by default.
MarginRightPoints The margin to the right of the content, in points. 20 by default.
MarginTopPoints The margin above the content, in points. 20 by default.
Media The media type the style sheets are evaluated for, as @media sees it. print by default, since a paginated document is a print medium.
PageHeightPoints The height of the page, in points. A4 (842) by default.
PageWidthPoints The width of the page, in points. A4 (595) by default.
SnapBorderWidthsToCssPixels Whether border widths snap to whole CSS pixels, as a browser’s do. Off by default.
SnapBoxDecorationsToCssPixels Whether box backgrounds and borders snap to whole CSS pixels, as a browser’s do. Off by default.
StyleSheet A style sheet parsed ahead of time, applied in place of UserStyleSheet (which is ignored when this is set), so the same parsed rules can serve many documents. It is not changed by loading.
UserStyleSheet CSS added to the built-in defaults and applied before the document’s own style sheets, or null for none.
Methods  
SetMargins(double) Sets all four margins to points.