diff --git a/HTML-conversions/Add-line-number-HTML-to-PDF-conversion/.NET/Add-line-number-HTML-to-PDF-conversion.sln b/HTML-conversions/Add-line-number-HTML-to-PDF-conversion/.NET/Add-line-number-HTML-to-PDF-conversion.sln
new file mode 100644
index 000000000..6f1e2ea65
--- /dev/null
+++ b/HTML-conversions/Add-line-number-HTML-to-PDF-conversion/.NET/Add-line-number-HTML-to-PDF-conversion.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.8.34322.80
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Add-line-number-HTML-to-PDF-conversion", "Add-line-number-HTML-to-PDF-conversion\Add-line-number-HTML-to-PDF-conversion.csproj", "{081A1582-C9CA-45BB-8165-2CFD3CAC5E83}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {081A1582-C9CA-45BB-8165-2CFD3CAC5E83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {081A1582-C9CA-45BB-8165-2CFD3CAC5E83}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {081A1582-C9CA-45BB-8165-2CFD3CAC5E83}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {081A1582-C9CA-45BB-8165-2CFD3CAC5E83}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {3904D757-E1D1-4AF0-908D-B7C731C2D459}
+ EndGlobalSection
+EndGlobal
diff --git a/HTML-conversions/Add-line-number-HTML-to-PDF-conversion/.NET/Add-line-number-HTML-to-PDF-conversion/Add-line-number-HTML-to-PDF-conversion.csproj b/HTML-conversions/Add-line-number-HTML-to-PDF-conversion/.NET/Add-line-number-HTML-to-PDF-conversion/Add-line-number-HTML-to-PDF-conversion.csproj
new file mode 100644
index 000000000..95a0f4086
--- /dev/null
+++ b/HTML-conversions/Add-line-number-HTML-to-PDF-conversion/.NET/Add-line-number-HTML-to-PDF-conversion/Add-line-number-HTML-to-PDF-conversion.csproj
@@ -0,0 +1,24 @@
+
Page1 This is an example paragraph with some placeholder text. It includes bold formatting for emphasis.
+Another sample sentence follows with italicized text for emphasis. This part is highlighted.
+This paragraph contains random words to simulate a real sentence structure.
+Additional content goes here...
+More text can be added in this section.
+Page2 This is the beginning of a new section with more example text.
+Here is another sample paragraph with generic placeholder content.
+Text continues with additional details and structured sentences.
+More words are added here to maintain flow and readability.
diff --git a/HTML-conversions/Add-line-number-HTML-to-PDF-conversion/.NET/Add-line-number-HTML-to-PDF-conversion/Output/.gitkeep b/HTML-conversions/Add-line-number-HTML-to-PDF-conversion/.NET/Add-line-number-HTML-to-PDF-conversion/Output/.gitkeep new file mode 100644 index 000000000..5f282702b --- /dev/null +++ b/HTML-conversions/Add-line-number-HTML-to-PDF-conversion/.NET/Add-line-number-HTML-to-PDF-conversion/Output/.gitkeep @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/HTML-conversions/Add-line-number-HTML-to-PDF-conversion/.NET/Add-line-number-HTML-to-PDF-conversion/Program.cs b/HTML-conversions/Add-line-number-HTML-to-PDF-conversion/.NET/Add-line-number-HTML-to-PDF-conversion/Program.cs new file mode 100644 index 000000000..224a92859 --- /dev/null +++ b/HTML-conversions/Add-line-number-HTML-to-PDF-conversion/.NET/Add-line-number-HTML-to-PDF-conversion/Program.cs @@ -0,0 +1,62 @@ +using Syncfusion.DocIO.DLS; +using Syncfusion.DocIO; +using Syncfusion.DocIORenderer; +using Syncfusion.Pdf; + +// Open the HTML file as a stream. +using (FileStream fileStreamPath = new FileStream(Path.GetFullPath(@"Data/Sample.html"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) +{ + // Load the file stream into a Word document in HTML format. + using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Html)) + { + // Instantiate DocIORenderer to handle Word to PDF conversion. + DocIORenderer render = new DocIORenderer(); + + // Split the HTML content into sections and add line numbers where necessary. + SplitSectionAndSetLineNumber(document); + + // Convert the modified Word document into a PDF document. + PdfDocument pdfDocument = render.ConvertToPDF(document); + + // Create a file stream for saving the output PDF file. + using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) + { + // Save the generated PDF document to the output file stream. + pdfDocument.Save(outputFileStream); + } + } +} + +///