HtmlToPdfPageWidthFromBrowserWindow Method

The page width follows the browser window width and the HTML is rendered without scaling, one CSS pixel being 0.75 points, or drawn uniformly larger or smaller by the zoom, on a page as wide as the window at that zoom

Definition

Namespace: HiQPdf.Next
Assembly: HiQPdf.Next (in HiQPdf.Next.dll) Version: 18.84.0
C#
public void PageWidthFromBrowserWindow(
	int windowWidth = 1024,
	bool singlePage = false,
	double zoom = 100
)

Parameters

windowWidth  Int32  (Optional)
The browser window width in pixels; the page width follows it
singlePage  Boolean  (Optional)
Render the whole HTML on one page, as tall as the content
zoom  Double  (Optional)
The zoom in percent, 10 to 200: the layout of the window drawn at this size, on a page that grows with it; 100 draws one CSS pixel as 0.75 points

Remarks

The browser window width and the zoom are set to fixed values. Margins set after the call are added to the page width, and the page size and the orientation give the page height. When the content is wider than the window, the window grows to it and the content is scaled down to the page, see AutoResizeBrowserWidth. The layouts for the usual cases are described in the "HTML to PDF Page Setup and Scaling" topic: HTML to PDF Page Setup and Scaling

See Also