Class

DesktopHTMLViewerPrintSettings


Description

Settings that customize how DesktopHTMLViewer.PrintToPDF renders a PDF, including the paper size, page orientation and margins.

Page widths, heights and margins are expressed in inches.

Important

This class is supported on macOS, Linux and Windows when using WebView2. It is not supported on Windows when using CEF.

Properties

Name

Type

Read-Only

Shared

Landscape

Boolean

MarginBottom

Double

MarginLeft

Double

MarginRight

Double

MarginTop

Double

PageHeight

Double

PageWidth

Double

PaperSize

PaperSizes

PrintHeadersAndFooters

Boolean

Enumerations

DesktopHTMLViewerPrintSettings.PaperSizes

PaperSizes

Enum

Description

Letter

US Letter paper size.

Legal

US Legal paper size.

A3

A3 paper size.

A4

A4 paper size.

A5

A5 paper size.

Custom

Custom paper size. The page size and margins come from the PageWidth, PageHeight and margin properties.


DesktopHTMLViewerPrintSettings.Landscape

Landscape As Boolean

If True, the PDF is printed in landscape orientation. The default is False (portrait).


DesktopHTMLViewerPrintSettings.MarginBottom

MarginBottom As Double

The bottom margin in inches. The default is 0.5. Only used when PaperSize is set to Custom.


DesktopHTMLViewerPrintSettings.MarginLeft

MarginLeft As Double

The left margin in inches. The default is 0.5. Only used when PaperSize is set to Custom.


DesktopHTMLViewerPrintSettings.MarginRight

MarginRight As Double

The right margin in inches. The default is 0.5. Only used when PaperSize is set to Custom.


DesktopHTMLViewerPrintSettings.MarginTop

MarginTop As Double

The top margin in inches. The default is 0.5. Only used when PaperSize is set to Custom.


DesktopHTMLViewerPrintSettings.PageHeight

PageHeight As Double

The page height in inches. The default is 11.0. Only used when PaperSize is set to Custom.


DesktopHTMLViewerPrintSettings.PageWidth

PageWidth As Double

The page width in inches. The default is 8.5. Only used when PaperSize is set to Custom.


DesktopHTMLViewerPrintSettings.PaperSize

PaperSize As PaperSizes

The paper size. The default is Letter. When set to anything other than Custom, the OS/WebView chooses the page size and margins, and the PageWidth, PageHeight and margin properties are ignored.


DesktopHTMLViewerPrintSettings.PrintHeadersAndFooters

PrintHeadersAndFooters As Boolean

If True, headers and footers are printed on each page. The default is False.

Important

This property is only supported on Windows.