Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Check-If-PDF-Is-Signed", "Check-If-PDF-Is-Signed\Check-If-PDF-Is-Signed.csproj", "{3DD425D8-40B2-4D5E-8ADD-66522B701503}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Verify_digital_sign_in_existing_PDF</RootNamespace>
<RootNamespace>Check-If-PDF-Is-Signed</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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 contains a form with fields
if (loadedDocument.Form == null || loadedDocument.Form.Fields.Count == 0)
{
Console.WriteLine("No signature fields found in the document.");
}
else
{
// Iterate through all fields in the form
foreach (PdfLoadedField field in loadedDocument.Form.Fields)
{
// Check if the field is a signature field
PdfLoadedSignatureField signatureField = field as PdfLoadedSignatureField;
if (signatureField != null)
{
// 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);
}

This file was deleted.