Platforms to show: All Mac Windows Linux Cross-Platform

Back to WebView2PrintSettingsMBS class.

WebView2PrintSettingsMBS.Collation as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Printer collation.

See kCollation* constants for descriptions of collation.
The default value is kCollationDefault.

Printing uses default value of printer's collation if an invalid value is provided for the specific printer.

This value is ignored in PrintToPdf method.
(Read and Write property)

WebView2PrintSettingsMBS.ColorMode as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Printer color mode.

See kColorMode* constants for descriptions of color modes.
The default value is kColorModeDefault.

Printing uses default value of printer supported color if an invalid value is provided for the specific printer.
(Read and Write property)

WebView2PrintSettingsMBS.Copies as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Number of copies to print.

Minimum value is 1 and the maximum copies count is 999. The default value is 1.
(Read and Write property)

WebView2PrintSettingsMBS.Duplex as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Printer duplex settings.

See kDuplex* constants for descriptions of duplex.
The default value is CoreWebView2PrintDuplex.Default.
Printing uses default value of printer's duplex if an invalid value is provided for the specific printer.
This value is ignored in PrintToPdf method.
(Read and Write property)

WebView2PrintSettingsMBS.FooterURI as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The URI in the footer if ShouldPrintHeaderAndFooter is true.

The default value is the current URI. If an empty string value is provided, no URI is shown in the footer.
(Read and Write property)

WebView2PrintSettingsMBS.HeaderTitle as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The title in the header if ShouldPrintHeaderAndFooter is true.

The default value is the title of the current document. If an empty string value is provided, no title is shown in the header.
(Read and Write property)

WebView2PrintSettingsMBS.MarginBottom as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The bottom margin in inches.

The default is 1 cm, or ~0.4 inches. A margin cannot be less than zero. If an invalid value is provided, the current value is not changed and an ArgumentException is thrown.
(Read and Write property)

WebView2PrintSettingsMBS.MarginLeft as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The left margin in inches.

The default is 1 cm, or ~0.4 inches. A margin cannot be less than zero. If an invalid value is provided, the current value is not changed and an ArgumentException is thrown.
(Read and Write property)

WebView2PrintSettingsMBS.MarginRight as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The right margin in inches.

The default is 1 cm, or ~0.4 inches. A margin cannot be less than zero. If an invalid value is provided, the current value is not changed and an ArgumentException is thrown.
(Read and Write property)

WebView2PrintSettingsMBS.MarginTop as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The top margin in inches.

The default is 1 cm, or ~0.4 inches. A margin cannot be less than zero. If an invalid value is provided, the current value is not changed and an ArgumentException is thrown.
(Read and Write property)

WebView2PrintSettingsMBS.Orientation as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The orientation can be portrait or landscape.

The default orientation is portrait. See kOrientation* constants.
(Read and Write property)

WebView2PrintSettingsMBS.PageHeight as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The page height in inches.

The default height is 11 inches. If the provided page height is less than or equal to zero, the current value is not changed and an ArgumentException is thrown.
(Read and Write property)

WebView2PrintSettingsMBS.PageRanges as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Page range to print.

Defaults to empty string, which means print all pages. The PageRanges property is a list of page ranges specifying one or more pages that should be printed separated by commas. Any whitespace between page ranges is ignored. A valid page range is either a single integer identifying the page to print, or a range in the form [start page]-[last page] where start page and last page are integers identifying the first and last inclusive pages respectively to print. Every page identifier is an integer greater than 0 unless wildcards are used (see below examples). The first page is 1.

In a page range of the form [start page]-[last page] the start page number must be larger than 0 and less than or equal to the document's total page count. If the start page is not present, then 1 is used as the start page. The last page must be larger than the start page. If the last page is not present, then the document total page count is used as the last page.

Repeating a page does not print it multiple times. To print multiple times, use the Copies property.

The pages are always printed in ascending order, even if specified in non-ascending order.
If page range is not valid or if a page is greater than document total page count, ArgumentException is thrown.

The following examples assume a document with 20 total pages.

ExampleResultNotes
"2"Page 2
"1-4, 9, 3-6, 10, 11"Pages 1-6, 9-11
"1-4, -6"Pages 1-6The "-6" is interpreted as "1-6".
"2-"Pages 2-20The "2-" is interpreted as "pages 2 to the end of the document".
"4-2, 11, -6"Invalid"4-2" is an invalid range.
"-"Pages 1-20The "-" is interpreted as "page 1 to the end of the document".
"1-4dsf, 11"Invalid
"2-2"Page 2
(Read and Write property)

WebView2PrintSettingsMBS.PagesPerSide as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Prints multiple pages of a document on a single piece of paper.

Choose from 1, 2, 4, 6, 9 or 16. The default value is 1.

If an invalid value is provided, ArgumentException is thrown.

Below examples shows print output for PagesPerSide and Duplex.

PagesPerSideTotal pagesTwo-sided printingResult
11-1 page on the front side.
21Yes1 page on the front side.
24-2 pages on the first paper and 2 pages on the next paper.
24Yes2 pages on the front side and 2 pages on back side.
44Yes4 pages on the front side.
48Yes4 pages on the front side and 4 pages on the back side.
(Read and Write property)

WebView2PrintSettingsMBS.PageWidth as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The page width in inches.

The default width is 8.5 inches. If the provided page width is less than or equal to zero, the current value is not changed and an ArgumentException is thrown.
(Read and Write property)

WebView2PrintSettingsMBS.PrinterName as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The name of the printer to use.

Defaults to empty string. If the printer name is empty string or null, then it prints to the default printer on the user OS.

If provided printer name doesn't match with the name of any installed printers on the user OS, the method returns with CoreWebView2PrintStatus.PrinterUnavailable.

Use DeviceInformation.FindAllAsync to get the list of local printers with AQS as "System.Devices.HardwareIds:~~"PRINTENUM\LocalPrintQueue""

This value is ignored in PrintToPdf method
(Read and Write property)

WebView2PrintSettingsMBS.ScaleFactor as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The scale factor is a value between 0.1 and 2.0.

The default is 1.0. If an invalid value is provided, the current value is not changed and an ArgumentException is thrown.
(Read and Write property)

WebView2PrintSettingsMBS.ShouldPrintBackgrounds as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
True if background colors and images should be printed.

The default value is false.
(Read and Write property)

WebView2PrintSettingsMBS.ShouldPrintHeaderAndFooter as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
True if header and footer should be printed.

The default value is false. The header consists of the date and time of printing, and the title of the page. The footer consists of the URI and page number. The height of the header and footer is 0.5 cm, or ~0.2 inches.
(Read and Write property)

WebView2PrintSettingsMBS.ShouldPrintSelectionOnly as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property WebView2 MBS WinFrameworks Plugin 23.2 ❌ No ✅ Yes ❌ No ❌ No Desktop only
True if only the current end user's selection of HTML in the document should be printed.

The default value is false.
(Read and Write property)

The items on this page are in the following plugins: MBS WinFrameworks Plugin.


The biggest plugin in space...