Enum HtmlToPdfToc.TabLeaderStyle
The type defines the tab leader list to connect the chapter titles and section headings to their corresponding page numbers
Namespace: Syncfusion.Pdf.HtmlToPdf
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public enum TabLeaderStyle
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/";
//Enable toc.
settings.EnableToc = true;
//Create a new instance for HTML to PDF toc.
HtmlToPdfToc toc = new HtmlToPdfToc();
//Set title.
toc.Title = "HTML to PDF";
//Set title alignment.
toc.TitleAlignment = PdfTextAlignment.Center;
//Create new HTML to PDF Toc Style.
HtmlToPdfTocStyle style = new HtmlToPdfTocStyle();
//Set background color.
style.BackgroundColor = new PdfSolidBrush(Color.LightCyan);
//Set font.
style.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
//Set fore color.
style.ForeColor = new PdfSolidBrush(Color.Red);
//Set paddings.
style.Padding = new PdfPaddings(5, 5, 5, 5);
//Set toc style.
toc.TitleStyle = style;
//Set the maximum header level.
toc.MaximumHeaderLevel = 5;
//Set tab leader style.
toc.TabLeader = HtmlToPdfToc.TabLeaderStyle.Dash;
//Set table leader character.
toc.TabLeaderChar = 'c';
//Set toc to webkit settings.
settings.Toc = toc;
//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/"
'Enable toc.
settings.EnableToc = True
'Create a new instance for HTML to PDF toc.
Dim toc As New HtmlToPdfToc()
'Set title.
toc.Title = "HTML to PDF"
'Set title alignment.
toc.TitleAlignment = PdfTextAlignment.Center
'Create new HTML to PDF Toc Style.
Dim style As New HtmlToPdfTocStyle()
'Set background color.
style.BackgroundColor = New PdfSolidBrush(Color.LightCyan)
'Set font.
style.Font = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
'Set fore color.
style.ForeColor = New PdfSolidBrush(Color.Red)
'Set paddings.
style.Padding = New PdfPaddings(5, 5, 5, 5)
'Set toc style.
toc.TitleStyle = style
'Set the maximum header level.
toc.MaximumHeaderLevel = 5
'Set tab leader style.
toc.TabLeader = HtmlToPdfToc.TabLeaderStyle.Dash
'Set table leader character.
toc.TabLeaderChar = "c"
'Set toc to webkit settings.
settings.Toc = toc
'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 |
---|---|
Dash | Connect the chapter titles and section headings to their corresponding page number with dashed line |
Dot | Connect the chapter titles and section headings to their corresponding page number with dotted line |
None | Don't apply tab leader |
Solid | Connect the chapter titles and section headings to their corresponding page numbers with solid line |