diff --git a/Digital Signature/Get-images-from-the-existing-signed-signature-field/.NET/Get-images-from-the-existing-signed-signature-field.sln b/Digital Signature/Get-images-from-the-existing-signed-signature-field/.NET/Get-images-from-the-existing-signed-signature-field.sln new file mode 100644 index 00000000..c5f12f9e --- /dev/null +++ b/Digital Signature/Get-images-from-the-existing-signed-signature-field/.NET/Get-images-from-the-existing-signed-signature-field.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33417.168 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Get-images-from-the-existing-signed-signature-field", "Get-images-from-the-existing-signed-signature-field\Get-images-from-the-existing-signed-signature-field.csproj", "{A30906C6-E5EF-484B-81D7-EF95CCF50F06}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A30906C6-E5EF-484B-81D7-EF95CCF50F06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A30906C6-E5EF-484B-81D7-EF95CCF50F06}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A30906C6-E5EF-484B-81D7-EF95CCF50F06}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A30906C6-E5EF-484B-81D7-EF95CCF50F06}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {EA52E8D5-E680-40DD-B3DF-CBC23E1463E7} + EndGlobalSection +EndGlobal diff --git a/Digital Signature/Get-images-from-the-existing-signed-signature-field/.NET/Get-images-from-the-existing-signed-signature-field/Get-images-from-the-existing-signed-signature-field.csproj b/Digital Signature/Get-images-from-the-existing-signed-signature-field/.NET/Get-images-from-the-existing-signed-signature-field/Get-images-from-the-existing-signed-signature-field.csproj new file mode 100644 index 00000000..afc4dce3 --- /dev/null +++ b/Digital Signature/Get-images-from-the-existing-signed-signature-field/.NET/Get-images-from-the-existing-signed-signature-field/Get-images-from-the-existing-signed-signature-field.csproj @@ -0,0 +1,15 @@ + + + + Exe + net7.0 + Get_images_from_the_existing_signed_signature_field + enable + enable + + + + + + + diff --git a/Digital Signature/Get-images-from-the-existing-signed-signature-field/.NET/Get-images-from-the-existing-signed-signature-field/Input.pdf b/Digital Signature/Get-images-from-the-existing-signed-signature-field/.NET/Get-images-from-the-existing-signed-signature-field/Input.pdf new file mode 100644 index 00000000..d9b1821f Binary files /dev/null and b/Digital Signature/Get-images-from-the-existing-signed-signature-field/.NET/Get-images-from-the-existing-signed-signature-field/Input.pdf differ diff --git a/Digital Signature/Get-images-from-the-existing-signed-signature-field/.NET/Get-images-from-the-existing-signed-signature-field/Program.cs b/Digital Signature/Get-images-from-the-existing-signed-signature-field/.NET/Get-images-from-the-existing-signed-signature-field/Program.cs new file mode 100644 index 00000000..8b47689a --- /dev/null +++ b/Digital Signature/Get-images-from-the-existing-signed-signature-field/.NET/Get-images-from-the-existing-signed-signature-field/Program.cs @@ -0,0 +1,21 @@ +using Syncfusion.Pdf.Interactive; +using Syncfusion.Pdf.Parsing; + +namespace Get_images_from_the_existing_signed_signature_field { + internal class Program { + static void Main(string[] args) { + //Load an existing PDF file. + FileStream fileStream = new FileStream(Path.GetFullPath("../../../Input.pdf"), FileMode.Open, FileAccess.Read); + PdfLoadedDocument ldoc = new PdfLoadedDocument(fileStream); + //Get the existing signed signature field. + PdfLoadedSignatureField loadedSignature = ldoc.Form.Fields[0] as PdfLoadedSignatureField; + //Get the image streams. + Stream[] imageStreams = loadedSignature.GetImages(); + for (int i = 0; i < imageStreams.Length; i++) { + File.WriteAllBytes("Output" + i.ToString() + ".jpg", (imageStreams[i] as MemoryStream).ToArray()); + } + //Close a PDF document. + ldoc.Close(true); + } + } +} \ No newline at end of file diff --git a/HTML to PDF/Blink/HTML-Header-and-Footer/.NET/HTML-Header-and-Footer.sln b/HTML to PDF/Blink/HTML-Header-and-Footer/.NET/HTML-Header-and-Footer.sln new file mode 100644 index 00000000..6d62c6cc --- /dev/null +++ b/HTML to PDF/Blink/HTML-Header-and-Footer/.NET/HTML-Header-and-Footer.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33417.168 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HTML-Header-and-Footer", "HTML-Header-and-Footer\HTML-Header-and-Footer.csproj", "{AE86576C-B426-4EB6-BE05-D07A860BB5B1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AE86576C-B426-4EB6-BE05-D07A860BB5B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AE86576C-B426-4EB6-BE05-D07A860BB5B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AE86576C-B426-4EB6-BE05-D07A860BB5B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AE86576C-B426-4EB6-BE05-D07A860BB5B1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {666C424D-4703-4323-A2B0-6424B87A7BD1} + EndGlobalSection +EndGlobal diff --git a/HTML to PDF/Blink/HTML-Header-and-Footer/.NET/HTML-Header-and-Footer/Data/Header.html b/HTML to PDF/Blink/HTML-Header-and-Footer/.NET/HTML-Header-and-Footer/Data/Header.html new file mode 100644 index 00000000..352ea2c5 --- /dev/null +++ b/HTML to PDF/Blink/HTML-Header-and-Footer/.NET/HTML-Header-and-Footer/Data/Header.html @@ -0,0 +1,9 @@ + + + + + +Yourmail@gmail.com
WWW.YourWebsite.Com
123, Main Street,
New York, United States
+ + \ No newline at end of file diff --git a/HTML to PDF/Blink/HTML-Header-and-Footer/.NET/HTML-Header-and-Footer/Data/footer.html b/HTML to PDF/Blink/HTML-Header-and-Footer/.NET/HTML-Header-and-Footer/Data/footer.html new file mode 100644 index 00000000..282793bb --- /dev/null +++ b/HTML to PDF/Blink/HTML-Header-and-Footer/.NET/HTML-Header-and-Footer/Data/footer.html @@ -0,0 +1,8 @@ + + + + + + ++80000 1234
+80000 5678Page of
+ \ No newline at end of file diff --git a/HTML to PDF/Blink/HTML-Header-and-Footer/.NET/HTML-Header-and-Footer/HTML-Header-and-Footer.csproj b/HTML to PDF/Blink/HTML-Header-and-Footer/.NET/HTML-Header-and-Footer/HTML-Header-and-Footer.csproj new file mode 100644 index 00000000..3b305fd4 --- /dev/null +++ b/HTML to PDF/Blink/HTML-Header-and-Footer/.NET/HTML-Header-and-Footer/HTML-Header-and-Footer.csproj @@ -0,0 +1,15 @@ + + + + Exe + net7.0 + HTML_Header_and_Footer + enable + enable + + + + + + + diff --git a/HTML to PDF/Blink/HTML-Header-and-Footer/.NET/HTML-Header-and-Footer/Program.cs b/HTML to PDF/Blink/HTML-Header-and-Footer/.NET/HTML-Header-and-Footer/Program.cs new file mode 100644 index 00000000..30d25e13 --- /dev/null +++ b/HTML to PDF/Blink/HTML-Header-and-Footer/.NET/HTML-Header-and-Footer/Program.cs @@ -0,0 +1,37 @@ +using Syncfusion.Drawing; +using Syncfusion.HtmlConverter; +using Syncfusion.Pdf; + +namespace HTML_Header_and_Footer { + internal class Program { + static void Main(string[] args) { + //Initialize HTML to PDF converter. + HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(); + //Initialize blink converter settings. + BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings(); + //Set the Blink viewport size. + blinkConverterSettings.ViewPortSize = new Size(1280, 0); + //Reade the html header and footer text from the html file or you can set html string also. + string headerTemplate = File.ReadAllText(@"..\..\..\Data\header.html"); + string footerTemplate = File.ReadAllText(@"..\..\..\Data\footer.html"); + //Set the html margin-top value based on the html header height and margin-top value. + blinkConverterSettings.Margin.Top = 70; + //Set the html margin-bottom value based on the html footer height and margin-bottom value. + blinkConverterSettings.Margin.Bottom = 40; + //Set the custom HTML header to add at the top of each page. + blinkConverterSettings.HtmlHeader = headerTemplate; + //Set the custom HTML footer to add at the bottom of each page. + blinkConverterSettings.HtmlFooter = footerTemplate; + //Assign Blink converter settings to the HTML converter. + htmlConverter.ConverterSettings = blinkConverterSettings; + //Convert the URL to a PDF document. + PdfDocument document = htmlConverter.Convert("https://www.syncfusion.com"); + + //Create a filestream. + FileStream fileStream = new FileStream("Output.pdf", FileMode.Create, FileAccess.ReadWrite); + //Save and close a PDF document. + document.Save(fileStream); + document.Close(true); + } + } +} \ No newline at end of file diff --git a/PDF Document/Remove-specific-keys-from-the-existing-document-information/.NET/Remove-specific-keys-from-the-existing-document-information.sln b/PDF Document/Remove-specific-keys-from-the-existing-document-information/.NET/Remove-specific-keys-from-the-existing-document-information.sln new file mode 100644 index 00000000..162d7ee3 --- /dev/null +++ b/PDF Document/Remove-specific-keys-from-the-existing-document-information/.NET/Remove-specific-keys-from-the-existing-document-information.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33417.168 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Remove-specific-keys-from-the-existing-document-information", "Remove-specific-keys-from-the-existing-document-information\Remove-specific-keys-from-the-existing-document-information.csproj", "{BB4C6EB7-449C-4983-A4BD-A39BFF111859}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BB4C6EB7-449C-4983-A4BD-A39BFF111859}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BB4C6EB7-449C-4983-A4BD-A39BFF111859}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BB4C6EB7-449C-4983-A4BD-A39BFF111859}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BB4C6EB7-449C-4983-A4BD-A39BFF111859}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {FB82F6AD-BB98-4EDA-9FE7-CD80EA034DBA} + EndGlobalSection +EndGlobal diff --git a/PDF Document/Remove-specific-keys-from-the-existing-document-information/.NET/Remove-specific-keys-from-the-existing-document-information/Input.pdf b/PDF Document/Remove-specific-keys-from-the-existing-document-information/.NET/Remove-specific-keys-from-the-existing-document-information/Input.pdf new file mode 100644 index 00000000..35360e56 Binary files /dev/null and b/PDF Document/Remove-specific-keys-from-the-existing-document-information/.NET/Remove-specific-keys-from-the-existing-document-information/Input.pdf differ diff --git a/PDF Document/Remove-specific-keys-from-the-existing-document-information/.NET/Remove-specific-keys-from-the-existing-document-information/Program.cs b/PDF Document/Remove-specific-keys-from-the-existing-document-information/.NET/Remove-specific-keys-from-the-existing-document-information/Program.cs new file mode 100644 index 00000000..9eab4598 --- /dev/null +++ b/PDF Document/Remove-specific-keys-from-the-existing-document-information/.NET/Remove-specific-keys-from-the-existing-document-information/Program.cs @@ -0,0 +1,28 @@ +using Syncfusion.Pdf.Parsing; + +namespace Remove_specific_keys_from_the_existing_document_information { + internal class Program { + static void Main(string[] args) { + //Load an existing PDF document. + FileStream fileStream = new FileStream(Path.GetFullPath("../../../Input.pdf"), FileMode.Open, FileAccess.Read); + PdfLoadedDocument document = new PdfLoadedDocument(fileStream); + //Remove the document information properties. + document.DocumentInformation.Remove("Title"); + document.DocumentInformation.Remove("Author"); + document.DocumentInformation.Remove("Subject"); + document.DocumentInformation.Remove("Keywords"); + document.DocumentInformation.Remove("Creator"); + document.DocumentInformation.Remove("Producer"); + document.DocumentInformation.Remove("ModDate"); + document.DocumentInformation.Remove("CreationDate"); + + //Creating the stream object. + MemoryStream stream = new MemoryStream(); + //Save the document into stream. + document.Save(stream); + File.WriteAllBytes("Output.pdf", stream.ToArray()); + //Close the document. + document.Close(true); + } + } +} \ No newline at end of file diff --git a/PDF Document/Remove-specific-keys-from-the-existing-document-information/.NET/Remove-specific-keys-from-the-existing-document-information/Remove-specific-keys-from-the-existing-document-information.csproj b/PDF Document/Remove-specific-keys-from-the-existing-document-information/.NET/Remove-specific-keys-from-the-existing-document-information/Remove-specific-keys-from-the-existing-document-information.csproj new file mode 100644 index 00000000..646e3871 --- /dev/null +++ b/PDF Document/Remove-specific-keys-from-the-existing-document-information/.NET/Remove-specific-keys-from-the-existing-document-information/Remove-specific-keys-from-the-existing-document-information.csproj @@ -0,0 +1,15 @@ + + + + Exe + net7.0 + Remove_specific_keys_from_the_existing_document_information + enable + enable + + + + + + +