diff --git a/HTML to PDF/Blink/Skip-cover-page-in-TOC-page-numbering/.NET/Skip-cover-page-in-TOC-page-numbering.sln b/HTML to PDF/Blink/Skip-cover-page-in-TOC-page-numbering/.NET/Skip-cover-page-in-TOC-page-numbering.sln new file mode 100644 index 00000000..e19f1987 --- /dev/null +++ b/HTML to PDF/Blink/Skip-cover-page-in-TOC-page-numbering/.NET/Skip-cover-page-in-TOC-page-numbering.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36616.10 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Skip-cover-page-in-TOC-page-numbering", "Skip-cover-page-in-TOC-page-numbering\Skip-cover-page-in-TOC-page-numbering.csproj", "{FCE9AE2D-9986-40DD-8B98-51ABE5153F05}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FCE9AE2D-9986-40DD-8B98-51ABE5153F05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FCE9AE2D-9986-40DD-8B98-51ABE5153F05}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FCE9AE2D-9986-40DD-8B98-51ABE5153F05}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FCE9AE2D-9986-40DD-8B98-51ABE5153F05}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {3898E2C3-F03F-4683-BB97-33F65A23EBAA} + EndGlobalSection +EndGlobal diff --git a/HTML to PDF/Blink/Skip-cover-page-in-TOC-page-numbering/.NET/Skip-cover-page-in-TOC-page-numbering/Data/coverpage.html b/HTML to PDF/Blink/Skip-cover-page-in-TOC-page-numbering/.NET/Skip-cover-page-in-TOC-page-numbering/Data/coverpage.html new file mode 100644 index 00000000..ca31a391 --- /dev/null +++ b/HTML to PDF/Blink/Skip-cover-page-in-TOC-page-numbering/.NET/Skip-cover-page-in-TOC-page-numbering/Data/coverpage.html @@ -0,0 +1,3 @@ +
+ + Syncfusion provides a comprehensive suite of UI components and tools for web, desktop, and mobile development. +
+ + ++ Essential Studio is a collection of over 1,700 components and frameworks for building modern applications. +
++ Syncfusion offers features like charts, grids, PDF generation, and reporting tools. +
+| Feature | +Description | +
|---|---|
| DataGrid | High-performance grid with sorting, filtering, and grouping. |
| Charts | Interactive charts for data visualization. |
| PDF Library | Create and manipulate PDF documents programmatically. |
| File Formats | Work with Excel, Word, and PowerPoint files. |
+ Syncfusion offers commercial licenses and a free community license for eligible developers. +
+ + ++ Access our support portal for assistance. You can also join our community forums. +
+ + + diff --git a/HTML to PDF/Blink/Skip-cover-page-in-TOC-page-numbering/.NET/Skip-cover-page-in-TOC-page-numbering/Output/gitkeep.txt b/HTML to PDF/Blink/Skip-cover-page-in-TOC-page-numbering/.NET/Skip-cover-page-in-TOC-page-numbering/Output/gitkeep.txt new file mode 100644 index 00000000..e69de29b diff --git a/HTML to PDF/Blink/Skip-cover-page-in-TOC-page-numbering/.NET/Skip-cover-page-in-TOC-page-numbering/Program.cs b/HTML to PDF/Blink/Skip-cover-page-in-TOC-page-numbering/.NET/Skip-cover-page-in-TOC-page-numbering/Program.cs new file mode 100644 index 00000000..04c078a5 --- /dev/null +++ b/HTML to PDF/Blink/Skip-cover-page-in-TOC-page-numbering/.NET/Skip-cover-page-in-TOC-page-numbering/Program.cs @@ -0,0 +1,36 @@ +using Syncfusion.Drawing; +using Syncfusion.HtmlConverter; +using Syncfusion.Pdf; + +// Create an instance of HTML-to-PDF converter +HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(); +// Configure Blink converter settings +BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings() +{ + ViewPortSize = new Size(1280, 0), // Set viewport width for rendering + EnableToc = true, // Enable Table of Contents (TOC) +}; +// Set TOC starting page number to skip the cover page +blinkConverterSettings.Toc.StartingPageNumber = 1; +// Apply the settings to the converter +htmlConverter.ConverterSettings = blinkConverterSettings; +// Read the main HTML content and convert it to PDF +string inputhtml = File.ReadAllText(Path.GetFullPath(@"Data/input.html")); +PdfDocument document = htmlConverter.Convert(inputhtml, ""); +//Create cover page and insert to the 0th index. +// Apply scaling settings for the cover page +htmlConverter.ConverterSettings = new BlinkConverterSettings() +{ + Scale = 1.5f +}; +// Convert the cover page HTML to PDF +string coverimage = File.ReadAllText(Path.GetFullPath(@"Data/coverpage.html")); +PdfDocument coverPage = htmlConverter.Convert(coverimage, ""); +// Insert the cover page at the beginning of the main document +document.Pages.Insert(0, coverPage.Pages[0]); +// Save the PDF document +document.Save(Path.GetFullPath(@"Output/Output.pdf")); +//Dispose the document +coverPage.Close(true); +document.Close(true); +htmlConverter.Close(); \ No newline at end of file diff --git a/HTML to PDF/Blink/Skip-cover-page-in-TOC-page-numbering/.NET/Skip-cover-page-in-TOC-page-numbering/Skip-cover-page-in-TOC-page-numbering.csproj b/HTML to PDF/Blink/Skip-cover-page-in-TOC-page-numbering/.NET/Skip-cover-page-in-TOC-page-numbering/Skip-cover-page-in-TOC-page-numbering.csproj new file mode 100644 index 00000000..57b4c631 --- /dev/null +++ b/HTML to PDF/Blink/Skip-cover-page-in-TOC-page-numbering/.NET/Skip-cover-page-in-TOC-page-numbering/Skip-cover-page-in-TOC-page-numbering.csproj @@ -0,0 +1,15 @@ +