HtmlToPdfConverterLayoutAtPageWidth Method
Renders the HTML at the width of the page, without scaling, with the screen media type unless another
media type is given. For HTML templates designed for a paper size, like invoices and reports
Namespace: EvoPdf.NextAssembly: EvoPdf.Next (in EvoPdf.Next.dll) Version: 14.75.0
public void LayoutAtPageWidth(
PdfPageSize pageSize,
PdfPageOrientation orientation = PdfPageOrientation.Portrait,
bool preferCssPageSize = false,
string mediaType = "screen"
)
Parameters
- pageSize PdfPageSize
- The page size
- orientation PdfPageOrientation (Optional)
- Portrait or landscape
- preferCssPageSize Boolean (Optional)
- Let a @page size rule in the HTML set the page size
- mediaType String (Optional)
- The CSS media type, "screen" or "print"
The page size, the orientation, the margins and the other options can be changed after the call: the
browser window width is computed from them when the PDF is generated.
Setting
HtmlViewerZoom or
HtmlViewerWidth after the call ends the automatic layout: the values
set are used as they are, without adjusting them to the page, until a layout method is called again.
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