Here are the steps to verify Barcode signature within the document with GroupDocs.Signature:
Create new instance ofΒ SignatureΒ class and pass source document path as a constructor parameter.
Use a LINQ query inside theΒ VerifyΒ method method to define verification criteria, such as checking that the signature type is Barcode and that the SignatureId equals “123”.
Execute the verification by calling theΒ VerifyΒ method and passing the query.
Process the verification result by iterating through the returned signatures if needed.
This example shows how to verify Barcode signature with LINQ query in the document
// Define the path to the PDF file.stringfilePath=Constants.SAMPLE_PDF;stringfileName=Path.GetFileName(filePath);// Use the 'using' statement for automatic resource management.using(varsignature=newSignature(filePath)){// Perform a varify to validate signatures of type Barcode with a specific SignatureId.varsignatures=signature.Verify(signatureItem=>signatureItem.SignatureType==SignatureType.Barcode&&signatureItem.SignatureId.Equals("123",StringComparison.Ordinal));// Optionally, process the verified signatures here.}
More resources
GitHub Examples
You may easily run the code above and see the feature in action in ourΒ GitHub examples: