diff --git a/FT page/Convert-HTML-to-PDF-document/.NET/Convert-HTML-to-PDF-document.sln b/FT page/Convert-HTML-to-PDF-document/.NET/Convert-HTML-to-PDF-document.sln new file mode 100644 index 00000000..8a539f91 --- /dev/null +++ b/FT page/Convert-HTML-to-PDF-document/.NET/Convert-HTML-to-PDF-document.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35707.178 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Convert-HTML-to-PDF-document", "Convert-HTML-to-PDF-document\Convert-HTML-to-PDF-document.csproj", "{8C7649A5-76C7-4869-91AA-6D5F662AC198}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8C7649A5-76C7-4869-91AA-6D5F662AC198}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8C7649A5-76C7-4869-91AA-6D5F662AC198}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8C7649A5-76C7-4869-91AA-6D5F662AC198}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8C7649A5-76C7-4869-91AA-6D5F662AC198}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/FT page/Convert-HTML-to-PDF-document/.NET/Convert-HTML-to-PDF-document/Convert-HTML-to-PDF-document.csproj b/FT page/Convert-HTML-to-PDF-document/.NET/Convert-HTML-to-PDF-document/Convert-HTML-to-PDF-document.csproj new file mode 100644 index 00000000..a5d9d9e1 --- /dev/null +++ b/FT page/Convert-HTML-to-PDF-document/.NET/Convert-HTML-to-PDF-document/Convert-HTML-to-PDF-document.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + Convert-HTML-to-PDF-document + enable + enable + + + + + + + diff --git a/FT page/Convert-HTML-to-PDF-document/.NET/Convert-HTML-to-PDF-document/Data/Output.pdf b/FT page/Convert-HTML-to-PDF-document/.NET/Convert-HTML-to-PDF-document/Data/Output.pdf new file mode 100644 index 00000000..9507197b Binary files /dev/null and b/FT page/Convert-HTML-to-PDF-document/.NET/Convert-HTML-to-PDF-document/Data/Output.pdf differ diff --git a/FT page/Convert-HTML-to-PDF-document/.NET/Convert-HTML-to-PDF-document/Output/gitkeep.txt b/FT page/Convert-HTML-to-PDF-document/.NET/Convert-HTML-to-PDF-document/Output/gitkeep.txt new file mode 100644 index 00000000..e69de29b diff --git a/FT page/Convert-HTML-to-PDF-document/.NET/Convert-HTML-to-PDF-document/Program.cs b/FT page/Convert-HTML-to-PDF-document/.NET/Convert-HTML-to-PDF-document/Program.cs new file mode 100644 index 00000000..61c5c19c --- /dev/null +++ b/FT page/Convert-HTML-to-PDF-document/.NET/Convert-HTML-to-PDF-document/Program.cs @@ -0,0 +1,17 @@ +using Syncfusion.HtmlConverter; +using Syncfusion.Pdf; +using Syncfusion.Pdf.HtmlToPdf; + +//Initialize the HTML to PDF converter. +HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(); + +//Convert URL to PDF document. +PdfDocument document = htmlConverter.Convert("https://www.syncfusion.com"); +//Create file stream. +using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) +{ + //Save the PDF document + document.Save(fileStream); +} +//Close the document. +document.Close(true); diff --git a/FT page/Create-Fillable-PDF-Forms/.NET/Create-Fillable-PDF-Forms.sln b/FT page/Create-Fillable-PDF-Forms/.NET/Create-Fillable-PDF-Forms.sln new file mode 100644 index 00000000..acd29d5e --- /dev/null +++ b/FT page/Create-Fillable-PDF-Forms/.NET/Create-Fillable-PDF-Forms.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35707.178 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Create-Fillable-PDF-Forms", "Create-Fillable-PDF-Forms\Create-Fillable-PDF-Forms.csproj", "{18D5CCA6-18F2-42EA-88B2-C776DCDEA246}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {18D5CCA6-18F2-42EA-88B2-C776DCDEA246}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {18D5CCA6-18F2-42EA-88B2-C776DCDEA246}.Debug|Any CPU.Build.0 = Debug|Any CPU + {18D5CCA6-18F2-42EA-88B2-C776DCDEA246}.Release|Any CPU.ActiveCfg = Release|Any CPU + {18D5CCA6-18F2-42EA-88B2-C776DCDEA246}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/FT page/Create-Fillable-PDF-Forms/.NET/Create-Fillable-PDF-Forms/Create-Fillable-PDF-Forms.csproj b/FT page/Create-Fillable-PDF-Forms/.NET/Create-Fillable-PDF-Forms/Create-Fillable-PDF-Forms.csproj new file mode 100644 index 00000000..8a2e4246 --- /dev/null +++ b/FT page/Create-Fillable-PDF-Forms/.NET/Create-Fillable-PDF-Forms/Create-Fillable-PDF-Forms.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + Create-Fillable-PDF-Forms + enable + enable + + + + + + + diff --git a/FT page/Create-Fillable-PDF-Forms/.NET/Create-Fillable-PDF-Forms/Data/Input.pdf b/FT page/Create-Fillable-PDF-Forms/.NET/Create-Fillable-PDF-Forms/Data/Input.pdf new file mode 100644 index 00000000..317a05bb Binary files /dev/null and b/FT page/Create-Fillable-PDF-Forms/.NET/Create-Fillable-PDF-Forms/Data/Input.pdf differ diff --git a/FT page/Create-Fillable-PDF-Forms/.NET/Create-Fillable-PDF-Forms/Data/Output.pdf b/FT page/Create-Fillable-PDF-Forms/.NET/Create-Fillable-PDF-Forms/Data/Output.pdf new file mode 100644 index 00000000..4796d515 Binary files /dev/null and b/FT page/Create-Fillable-PDF-Forms/.NET/Create-Fillable-PDF-Forms/Data/Output.pdf differ diff --git a/FT page/Create-Fillable-PDF-Forms/.NET/Create-Fillable-PDF-Forms/Output/gitkeep.txt b/FT page/Create-Fillable-PDF-Forms/.NET/Create-Fillable-PDF-Forms/Output/gitkeep.txt new file mode 100644 index 00000000..e69de29b diff --git a/FT page/Create-Fillable-PDF-Forms/.NET/Create-Fillable-PDF-Forms/Program.cs b/FT page/Create-Fillable-PDF-Forms/.NET/Create-Fillable-PDF-Forms/Program.cs new file mode 100644 index 00000000..3f839626 --- /dev/null +++ b/FT page/Create-Fillable-PDF-Forms/.NET/Create-Fillable-PDF-Forms/Program.cs @@ -0,0 +1,46 @@ +using Syncfusion.Pdf.Parsing; + +// Load the existing PDF document. +using (FileStream docStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read)) +using (PdfLoadedDocument loadedDocument = new PdfLoadedDocument(docStream)) +{ + // Create the form if it doesn't exist. + if (loadedDocument.Form == null) + loadedDocument.CreateForm(); + + // Fill in the name text box. + PdfLoadedTextBoxField name = loadedDocument.Form.Fields[1] as PdfLoadedTextBoxField; + name.Text = "John Milton"; + + // Fill in the email text box. + PdfLoadedTextBoxField email = loadedDocument.Form.Fields[2] as PdfLoadedTextBoxField; + email.Text = "john.milton@example.com"; + + // Select a gender radio button (0 = first option). + PdfLoadedRadioButtonListField gender = loadedDocument.Form.Fields[3] as PdfLoadedRadioButtonListField; + gender.SelectedIndex = 0; + + // Fill in the date of birth field. + PdfLoadedTextBoxField dob = loadedDocument.Form.Fields[0] as PdfLoadedTextBoxField; + dob.Text = "May 12, 2000"; + + // Select a country from the combo box. + PdfLoadedComboBoxField country = loadedDocument.Form.Fields[4] as PdfLoadedComboBoxField; + country.SelectedValue = "Alabama"; + + // Check the newsletter subscription box. + PdfLoadedCheckBoxField newsletter = loadedDocument.Form.Fields[5] as PdfLoadedCheckBoxField; + newsletter.Checked = true; + + // Ensure proper rendering in PDF viewers. + loadedDocument.Form.SetDefaultAppearance(false); + + // Save the updated PDF to a new file. + using (FileStream outputStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) + { + loadedDocument.Save(outputStream); + } + + // Close the PDF document. + loadedDocument.Close(true); +} \ No newline at end of file diff --git a/FT page/Generating-Accessible-PDF-document/.NET/Generating-Accessible-PDF-document.sln b/FT page/Generating-Accessible-PDF-document/.NET/Generating-Accessible-PDF-document.sln new file mode 100644 index 00000000..95548d23 --- /dev/null +++ b/FT page/Generating-Accessible-PDF-document/.NET/Generating-Accessible-PDF-document.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35707.178 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Generating-Accessible-PDF-document", "Generating-Accessible-PDF-document\Generating-Accessible-PDF-document.csproj", "{CFF443D6-AA37-4C7A-9DE7-334651E659DB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CFF443D6-AA37-4C7A-9DE7-334651E659DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CFF443D6-AA37-4C7A-9DE7-334651E659DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CFF443D6-AA37-4C7A-9DE7-334651E659DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CFF443D6-AA37-4C7A-9DE7-334651E659DB}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/FT page/Generating-Accessible-PDF-document/.NET/Generating-Accessible-PDF-document/Data/Image.jpg b/FT page/Generating-Accessible-PDF-document/.NET/Generating-Accessible-PDF-document/Data/Image.jpg new file mode 100644 index 00000000..86f87c5c Binary files /dev/null and b/FT page/Generating-Accessible-PDF-document/.NET/Generating-Accessible-PDF-document/Data/Image.jpg differ diff --git a/FT page/Generating-Accessible-PDF-document/.NET/Generating-Accessible-PDF-document/Data/Output.pdf b/FT page/Generating-Accessible-PDF-document/.NET/Generating-Accessible-PDF-document/Data/Output.pdf new file mode 100644 index 00000000..9fdff3b9 Binary files /dev/null and b/FT page/Generating-Accessible-PDF-document/.NET/Generating-Accessible-PDF-document/Data/Output.pdf differ diff --git a/FT page/Generating-Accessible-PDF-document/.NET/Generating-Accessible-PDF-document/Generating-Accessible-PDF-document.csproj b/FT page/Generating-Accessible-PDF-document/.NET/Generating-Accessible-PDF-document/Generating-Accessible-PDF-document.csproj new file mode 100644 index 00000000..f0ca7c79 --- /dev/null +++ b/FT page/Generating-Accessible-PDF-document/.NET/Generating-Accessible-PDF-document/Generating-Accessible-PDF-document.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + Generating-Accessible-PDF-document + enable + enable + + + + + + + diff --git a/FT page/Generating-Accessible-PDF-document/.NET/Generating-Accessible-PDF-document/Output/gitkeep.txt b/FT page/Generating-Accessible-PDF-document/.NET/Generating-Accessible-PDF-document/Output/gitkeep.txt new file mode 100644 index 00000000..e69de29b diff --git a/FT page/Generating-Accessible-PDF-document/.NET/Generating-Accessible-PDF-document/Program.cs b/FT page/Generating-Accessible-PDF-document/.NET/Generating-Accessible-PDF-document/Program.cs new file mode 100644 index 00000000..6a11ea59 --- /dev/null +++ b/FT page/Generating-Accessible-PDF-document/.NET/Generating-Accessible-PDF-document/Program.cs @@ -0,0 +1,72 @@ +using Syncfusion.Drawing; +using Syncfusion.Pdf; +using Syncfusion.Pdf.Graphics; + +// Create a new PDF document +using (PdfDocument document = new PdfDocument()) +{ + // Set document metadata + document.DocumentInformation.Title = "Tagged PDF with Top-Centered Image and Text"; + + // Add a new page + PdfPage page = document.Pages.Add(); + + // Load image stream + using (FileStream imgStream = new FileStream(Path.GetFullPath(@"Data/Image.jpg"), FileMode.Open, FileAccess.Read)) + { + PdfBitmap image = new PdfBitmap(imgStream); + + // Define desired image size + float imageWidth = 200; + float imageHeight = 100; + + // Calculate X and Y to center image at the top + float pageWidth = page.Graphics.ClientSize.Width; + float imageX = (pageWidth - imageWidth) / 2; + float imageY = 20; + + // Set the tag type and alternate text for accessibility + PdfStructureElement imageElement = new PdfStructureElement(PdfTagType.Figure) + { + AlternateText = "GreenTree" + }; + image.PdfTag = imageElement; + + // Draw the image at the top center + page.Graphics.DrawImage(image, new RectangleF(imageX, imageY, imageWidth, imageHeight)); + + // Add paragraph text below the image + string paragraphText = + "Adventure Works Cycles, the fictitious company on which the AdventureWorks sample databases are based, is a large, multinational manufacturing company. " + + "The company manufactures and sells metal and composite bicycles to North American, European, and Asian commercial markets. " + + "While its base operation is located in Washington with 290 employees, several regional sales teams are located throughout their market base. " + + "The company is known for its commitment to innovation, quality, and customer satisfaction, catering to both amateur and professional cycling enthusiasts.\n\n" + + "In addition to bicycles, Adventure Works Cycles also provides a wide range of cycling accessories, apparel, and maintenance tools through retail and online platforms. " + + "The company invests heavily in research and development to improve performance and safety in its products. " + + "With an integrated global supply chain, efficient logistics operations, and a customer-centric approach, Adventure Works Cycles continues to be a recognized brand in the global cycling industry."; + + // Create structure element for paragraph + PdfStructureElement paragraphStructure = new PdfStructureElement(PdfTagType.Paragraph) + { + ActualText = "Company introduction paragraph" + }; + + // Create and configure the text element + PdfTextElement textElement = new PdfTextElement(paragraphText) + { + PdfTag = paragraphStructure, + Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12), + Brush = new PdfSolidBrush(new PdfColor(89, 89, 93)) + }; + + // Draw the text below the image + float textY = imageY + imageHeight + 20; + textElement.Draw(page, new RectangleF(20, textY, pageWidth - 40, 400)); + } + + // Save the PDF document + using (FileStream outputFile = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) + { + document.Save(outputFile); + } +} \ No newline at end of file diff --git a/FT page/Protect-PDF-documents/.NET/Protect-PDF-documents.sln b/FT page/Protect-PDF-documents/.NET/Protect-PDF-documents.sln new file mode 100644 index 00000000..6fb28df6 --- /dev/null +++ b/FT page/Protect-PDF-documents/.NET/Protect-PDF-documents.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35707.178 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Protect-PDF-documents", "Protect-PDF-documents\Protect-PDF-documents.csproj", "{1B2AC0AB-F0B6-4123-9A22-AD59C3A2C1BB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1B2AC0AB-F0B6-4123-9A22-AD59C3A2C1BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1B2AC0AB-F0B6-4123-9A22-AD59C3A2C1BB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1B2AC0AB-F0B6-4123-9A22-AD59C3A2C1BB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1B2AC0AB-F0B6-4123-9A22-AD59C3A2C1BB}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/FT page/Protect-PDF-documents/.NET/Protect-PDF-documents/Data/Input.pdf b/FT page/Protect-PDF-documents/.NET/Protect-PDF-documents/Data/Input.pdf new file mode 100644 index 00000000..58577c55 Binary files /dev/null and b/FT page/Protect-PDF-documents/.NET/Protect-PDF-documents/Data/Input.pdf differ diff --git a/FT page/Protect-PDF-documents/.NET/Protect-PDF-documents/Data/Output.pdf b/FT page/Protect-PDF-documents/.NET/Protect-PDF-documents/Data/Output.pdf new file mode 100644 index 00000000..15448044 Binary files /dev/null and b/FT page/Protect-PDF-documents/.NET/Protect-PDF-documents/Data/Output.pdf differ diff --git a/FT page/Protect-PDF-documents/.NET/Protect-PDF-documents/Output/gitkeep.txt b/FT page/Protect-PDF-documents/.NET/Protect-PDF-documents/Output/gitkeep.txt new file mode 100644 index 00000000..e69de29b diff --git a/FT page/Protect-PDF-documents/.NET/Protect-PDF-documents/Program.cs b/FT page/Protect-PDF-documents/.NET/Protect-PDF-documents/Program.cs new file mode 100644 index 00000000..c399e939 --- /dev/null +++ b/FT page/Protect-PDF-documents/.NET/Protect-PDF-documents/Program.cs @@ -0,0 +1,24 @@ +using Syncfusion.Pdf.Parsing; +using Syncfusion.Pdf.Security; + +// Load the PDF document from a file stream +using (FileStream inputFileStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read)) +{ + // Load the PDF document + PdfLoadedDocument document = new PdfLoadedDocument(inputFileStream); + // Gets a security object for the document + PdfSecurity security = document.Security; + // Configure key size and encryption algorithm + security.KeySize = PdfEncryptionKeySize.Key256Bit; + security.Algorithm = PdfEncryptionAlgorithm.AES; + // Assign owner and user passwords + security.OwnerPassword = "owner123"; + security.UserPassword = "user123"; + // Save the PDF document in to a file stream + using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) + { + document.Save(outputFileStream); + } + // Close the document + document.Close(true); +} diff --git a/FT page/Protect-PDF-documents/.NET/Protect-PDF-documents/Protect-PDF-documents.csproj b/FT page/Protect-PDF-documents/.NET/Protect-PDF-documents/Protect-PDF-documents.csproj new file mode 100644 index 00000000..7b3adb86 --- /dev/null +++ b/FT page/Protect-PDF-documents/.NET/Protect-PDF-documents/Protect-PDF-documents.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + Protect-PDF-documents + enable + enable + + + + + + + diff --git a/FT page/Split-PDF-files/.NET/Split-PDF-files-in-C#.sln b/FT page/Split-PDF-files/.NET/Split-PDF-files-in-C#.sln new file mode 100644 index 00000000..217a3d16 --- /dev/null +++ b/FT page/Split-PDF-files/.NET/Split-PDF-files-in-C#.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35707.178 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Split-PDF-files", "Split-PDF-files\Split-PDF-files.csproj", "{283A1CFF-09CC-44B3-89BA-FABA4425EC4C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {283A1CFF-09CC-44B3-89BA-FABA4425EC4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {283A1CFF-09CC-44B3-89BA-FABA4425EC4C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {283A1CFF-09CC-44B3-89BA-FABA4425EC4C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {283A1CFF-09CC-44B3-89BA-FABA4425EC4C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/FT page/Split-PDF-files/.NET/Split-PDF-files/Data/Input.pdf b/FT page/Split-PDF-files/.NET/Split-PDF-files/Data/Input.pdf new file mode 100644 index 00000000..ec829134 Binary files /dev/null and b/FT page/Split-PDF-files/.NET/Split-PDF-files/Data/Input.pdf differ diff --git a/FT page/Split-PDF-files/.NET/Split-PDF-files/Data/SplitOutput.zip b/FT page/Split-PDF-files/.NET/Split-PDF-files/Data/SplitOutput.zip new file mode 100644 index 00000000..307682a5 Binary files /dev/null and b/FT page/Split-PDF-files/.NET/Split-PDF-files/Data/SplitOutput.zip differ diff --git a/FT page/Split-PDF-files/.NET/Split-PDF-files/Output/gitkeep.txt b/FT page/Split-PDF-files/.NET/Split-PDF-files/Output/gitkeep.txt new file mode 100644 index 00000000..e69de29b diff --git a/FT page/Split-PDF-files/.NET/Split-PDF-files/Program.cs b/FT page/Split-PDF-files/.NET/Split-PDF-files/Program.cs new file mode 100644 index 00000000..52335f5b --- /dev/null +++ b/FT page/Split-PDF-files/.NET/Split-PDF-files/Program.cs @@ -0,0 +1,28 @@ +using Syncfusion.Pdf; +using Syncfusion.Pdf.Parsing; + +// Create the FileStream object to read the input PDF file +using (FileStream inputFileStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) +{ + // Load the PDF document from the input stream + using (PdfLoadedDocument loadedDocument = new PdfLoadedDocument(inputFileStream)) + { + // Iterate over the pages of the loaded document + for (int pageIndex = 0; pageIndex < loadedDocument.PageCount; pageIndex++) + { + // Create a new PdfDocument object to hold the output + using (PdfDocument outputDocument = new PdfDocument()) + { + // Import the page from the loadedDocument to the outputDocument + outputDocument.ImportPage(loadedDocument, pageIndex); + + // Create the FileStream object to write the output PDF file + using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/" + pageIndex + ".pdf"), FileMode.Create, FileAccess.Write)) + { + // Save the outputDocument into the outputFileStream + outputDocument.Save(outputFileStream); + } + } + } + } +} diff --git a/FT page/Split-PDF-files/.NET/Split-PDF-files/Split-PDF-files.csproj b/FT page/Split-PDF-files/.NET/Split-PDF-files/Split-PDF-files.csproj new file mode 100644 index 00000000..d3ecb6a0 --- /dev/null +++ b/FT page/Split-PDF-files/.NET/Split-PDF-files/Split-PDF-files.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + Split-PDF-files + enable + enable + + + + + + +