Click or drag to resize
Pdf Library for .NET

PdfHtmlElementWebPageHeight Property

Gets or sets the height of the converted web page as it would appear in the internal browser used to render the html.

Namespace: SelectPdf
Assembly: Select.Pdf (in Select.Pdf.dll) Version: 26.4
Syntax
public int WebPageHeight { get; set; }

Property Value

Int32
Remarks
The web page height is specified in pixels and the default value is 0px. This means that the converter will automatically calculate the page height.

Generally this property does not need to be changed, but there are situations when the converter cannot calculate correctly the web page height (for example for web pages with frames) and in that case, WebPageHeight needs to be set, otherwise no content might appear in the generated pdf.

Note: the height on its own does not limit what is converted - it is the size of the browser viewport, so it also decides what 100vh resolves to and what counts as visible for lazily loaded content. To leave the content that does not fit this height out of the generated pdf document, set WebPageFixedSize to true as well.

This property can also be set directly in the constructor of PdfHtmlElement class.

See Also