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.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.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.

The height does not limit what is converted: the whole web page is converted and flows onto as many pdf pages as it needs. To leave out the content below this height, set WebPageFixedSize to true as well.

It is the height of the browser window the page is loaded in: the height scripts on the page see (window.innerHeight) and what decides which parts of the page count as visible while it loads. With the default value the window is as tall as the area of a pdf page the content is printed in, so scripts see the page they are printed on. With ManagedContentTrimming set to false the window has almost no height while the page loads, and content that a script sizes from the window height, or loads or reveals only once it is scrolled into view, can be missing from the generated pdf; for such pages set a height, for example 768.

The printed layout does not depend on it: CSS viewport units such as 100vh are resolved against the pdf page.

See Also