Class CoreWebView2PrintSettings() Foundation

A class for manipulating the internal print settings of a XbpHTMLViewer2 object.

Description

Instances of the CoreWebView2PrintSettings class are used to expose various WebView2-specific output settings via their member variables. Applications can change these settings by first specifying the desired values in a CoreWebView2PrintSettings object, and then passing the settings object to the methods XbpHTMLViewer2():print() or XbpHTMLViewer2():printToFile(). The CoreWebView2PrintSettings class itself handles validation but contains no additional logic.

The member variables of a CoreWebView2PrintSettings object correspond to the native WebView2 options defined in the ICoreWebView2PrintSettings and its derived COM interfaces. More information about the available output settings and their respective values can be found here: https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2printsettings?view=webview2-1.0.3179.45.

Note that these options are distributed over several interfaces (ICoreWebView2PrintSettings, ICoreWebView2PrintSettings2 etc.). The CoreWebView2PrintSettings class allows changing all options which use scalar values via a single interface and currently supports the interfaces ICoreWebView2PrintSettings and ICoreWebViewPrintSettings2.

Runtime Data
:Collation
Controls the collation of multiple copies.
:ColorMode
Controls color or monochrome printing.
:Copies
Specifies the number of copies to print.
:Duplex
Controls duplex (two-sided) printing.
:FooterUri
Specifies the URI displayed in the footer.
:HeaderTitle
Specifies custom header title text.
:MarginBottom
Defines the bottom margin in inches.
:MarginLeft
Defines the left margin in inches.
:MarginRight
Defines the right margin in inches.
:MarginTop
Defines the top margin in inches.
:MediaSize
Controls the media size setting.
:Orientation
Specifies the print orientation.
:PageHeight
Sets the page height in inches.
:PageRanges
Specifies which pages to print.
:PageWidth
Sets the page width in inches.
:PagesPerSide
Sets the number of pages per sheet.
:PrinterName
Specifies the target printer device name.
:ScaleFactor
Controls the scaling factor for printed content.
:ShouldPrintBackgrounds
Controls printing of background colors and images.
:ShouldPrintHeaderAndFooter
Controls printing of headers and footers.
:ShouldPrintSelectionOnly
Controls printing of selected content only.
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.