diff --git a/Digital Signature/New folder/.NET/Verify-digital-sign-in-existing-PDF.sln b/Digital Signature/New folder/.NET/Verify-digital-sign-in-existing-PDF.sln new file mode 100644 index 00000000..9a950b5e --- /dev/null +++ b/Digital Signature/New folder/.NET/Verify-digital-sign-in-existing-PDF.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}") = "Verify-digital-sign-in-existing-PDF", "Verify-digital-sign-in-existing-PDF\Verify-digital-sign-in-existing-PDF.csproj", "{3DD425D8-40B2-4D5E-8ADD-66522B701503}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3DD425D8-40B2-4D5E-8ADD-66522B701503}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3DD425D8-40B2-4D5E-8ADD-66522B701503}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3DD425D8-40B2-4D5E-8ADD-66522B701503}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3DD425D8-40B2-4D5E-8ADD-66522B701503}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Digital Signature/New folder/.NET/Verify-digital-sign-in-existing-PDF/Data/Input.pdf b/Digital Signature/New folder/.NET/Verify-digital-sign-in-existing-PDF/Data/Input.pdf new file mode 100644 index 00000000..08e9a37d Binary files /dev/null and b/Digital Signature/New folder/.NET/Verify-digital-sign-in-existing-PDF/Data/Input.pdf differ diff --git a/Digital Signature/New folder/.NET/Verify-digital-sign-in-existing-PDF/Program.cs b/Digital Signature/New folder/.NET/Verify-digital-sign-in-existing-PDF/Program.cs new file mode 100644 index 00000000..e1eb0f3e --- /dev/null +++ b/Digital Signature/New folder/.NET/Verify-digital-sign-in-existing-PDF/Program.cs @@ -0,0 +1,35 @@ +using System; +using System.IO; +using System.Reflection.Metadata; +using Syncfusion.Pdf.Parsing; + + +// Open the signed PDF file for reading +using (FileStream inputFileStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read)) +{ + // Load the PDF document + PdfLoadedDocument loadedDocument = new PdfLoadedDocument(inputFileStream); + + // Check if the document has a form (which would contain signature fields) + if (loadedDocument.Form == null) + { + Console.WriteLine("No signature fields found in the document."); + return; + } + + // Iterate through all fields in the form + foreach (var field in loadedDocument.Form.Fields) + { + // Check if the field is a signature field + if (field is PdfLoadedSignatureField signatureField) + { + // Determine whether the signature field is signed or not + string status = signatureField.IsSigned ? "Signed" : "UnSigned"; + + // Output the result for each signature field + Console.WriteLine($"Signature Field {signatureField.Name} is : {status}"); + } + } + //Close the document + loadedDocument.Close(true); +} \ No newline at end of file diff --git a/Digital Signature/New folder/.NET/Verify-digital-sign-in-existing-PDF/Verify-digital-sign-in-existing-PDF.csproj b/Digital Signature/New folder/.NET/Verify-digital-sign-in-existing-PDF/Verify-digital-sign-in-existing-PDF.csproj new file mode 100644 index 00000000..dd4b0f0c --- /dev/null +++ b/Digital Signature/New folder/.NET/Verify-digital-sign-in-existing-PDF/Verify-digital-sign-in-existing-PDF.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + Verify_digital_sign_in_existing_PDF + enable + enable + + + + + + + diff --git a/Shapes/Dash-pattern-in-shapes/.NET/Dash-pattern-in-shapes.sln b/Shapes/Dash-pattern-in-shapes/.NET/Dash-pattern-in-shapes.sln new file mode 100644 index 00000000..b9b961bb --- /dev/null +++ b/Shapes/Dash-pattern-in-shapes/.NET/Dash-pattern-in-shapes.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}") = "Dash-pattern-in-shapes", "Dash-pattern-in-shapes\Dash-pattern-in-shapes.csproj", "{DF549026-34A6-4622-9A1D-8C12AE115DAE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DF549026-34A6-4622-9A1D-8C12AE115DAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DF549026-34A6-4622-9A1D-8C12AE115DAE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DF549026-34A6-4622-9A1D-8C12AE115DAE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DF549026-34A6-4622-9A1D-8C12AE115DAE}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Shapes/Dash-pattern-in-shapes/.NET/Dash-pattern-in-shapes/Dash-pattern-in-shapes.csproj b/Shapes/Dash-pattern-in-shapes/.NET/Dash-pattern-in-shapes/Dash-pattern-in-shapes.csproj new file mode 100644 index 00000000..897089fb --- /dev/null +++ b/Shapes/Dash-pattern-in-shapes/.NET/Dash-pattern-in-shapes/Dash-pattern-in-shapes.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + Dash_pattern_in_shapes + enable + enable + + + + + + + diff --git a/Shapes/Dash-pattern-in-shapes/.NET/Dash-pattern-in-shapes/Output/gitkeep.txt b/Shapes/Dash-pattern-in-shapes/.NET/Dash-pattern-in-shapes/Output/gitkeep.txt new file mode 100644 index 00000000..e69de29b diff --git a/Shapes/Dash-pattern-in-shapes/.NET/Dash-pattern-in-shapes/Program.cs b/Shapes/Dash-pattern-in-shapes/.NET/Dash-pattern-in-shapes/Program.cs new file mode 100644 index 00000000..0c602104 --- /dev/null +++ b/Shapes/Dash-pattern-in-shapes/.NET/Dash-pattern-in-shapes/Program.cs @@ -0,0 +1,34 @@ +using Syncfusion.Pdf.Graphics; +using Syncfusion.Pdf; +using Syncfusion.Drawing; + +// Create a new PDF document +PdfDocument document = new PdfDocument(); + +// Add a page to the document +PdfPage page = document.Pages.Add(); + +// Create a PdfGraphics object to draw on the page +PdfGraphics graphics = page.Graphics; + +// Create a custom dashed line pattern (5-point dash, 2-point gap) +float[] dashPattern = { 5, 2 }; // Dash length, gap length + +// Create a PdfPen with the dash pattern and color +PdfPen dashPen = new PdfPen(PdfBrushes.Black, 2); // 2 is the line width + +// Set the DashStyle to Custom before applying DashPattern +dashPen.DashStyle = PdfDashStyle.Custom; // Use Custom style to enable DashPattern +dashPen.DashPattern = dashPattern; + +// Draw a line with the custom dash pattern +graphics.DrawLine(dashPen, new Syncfusion.Drawing.PointF(10, 10), new PointF(300, 10)); + +//Create file stream. +using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) +{ + //Save the PDF document to file stream. + document.Save(outputFileStream); +} +//Close the document. +document.Close(true); \ No newline at end of file