Enum SinglePageLayout
Use this option to render the whole HTML content into a single PDF page
Namespace: Syncfusion.Pdf.HtmlToPdf
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public enum SinglePageLayout
Examples
/// //Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
//Create a new instance for webkit converter settings.
WebKitConverterSettings settings = new WebKitConverterSettings();
//Set WebKit path
settings.WebKitPath = @"QtBinaries";
//Set signle page layout.
settings.SinglePageLayout = SinglePageLayout.FitHeight;
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = settings;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://en.wikipedia.org/wiki/.NET_Framework");
//Save and close the PDF document
document.Save("Output.pdf");
document.Close(true);
'Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter(HtmlRenderingEngine.WebKit)
'Create a new instance for webkit converter settings.
Dim settings As New WebKitConverterSettings()
'Set WebKit path
settings.WebKitPath = "QtBinaries"
'Set signle page layout.
settings.SinglePageLayout = SinglePageLayout.FitHeight
'Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = settings
'Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://en.wikipedia.org/wiki/.NET_Framework")
'Save and close the PDF document
document.Save("Output.pdf")
document.Close(True)
Fields
Name | Description |
---|---|
FitHeight | The page height is not resized to fit the HTML content PDF page |
FitWidth | The page width is not resized to fit the HTML content to PDF page |
None | Do not apply single page layout |