Click or drag to resize
Pdf Library for .NET

PdfHtmlElementWebPageFixedSize Property

Controls whether the web page is rendered with a fixed size internal browser or the size automatically extends to make the whole content visible.

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

Property Value

Boolean
Remarks
The default value of this property is false.

If the web page does not fit the dimensions specified by the WebPageWidth and WebPageHeight properties and WebPageFixedSize is set to false, the converter will try to automatically calculate a larger width and height to be able to display the whole html content.

If WebPageFixedSize is set to true, this will indicate the converter not to calculate another width and height, but use width and height specified by WebPageWidth and WebPageHeight. These dimensions with be used even though the content will not fit the available space and it will be truncated.

A fixed size taller than the space available on the pdf page is spread over as many pages as it needs - it is not squeezed onto a single page. With the Blink and Chromium engines every page but the last is a full page and the last one is cut at the height asked for: the content below it is removed from the document, not hidden, and bookmarks, mapped web elements, links and internal destinations follow the same height. A line of text is never cut - when one crosses that height, the last page ends above it. These engines also move a line that crosses the bottom of a page onto the next page, so a fixed size spanning several pdf pages can end up to one line short of the height asked for at each page boundary it crosses. The WebKit engines cut exactly at the height.

Note: WebPageFixedSize needs a page height set with WebPageHeight - there is no size to fix the browser at otherwise. With the default value (0) the WebKit engines fail (they cannot render a web page with no height) and the Blink and Chromium engines ignore this property.

See Also