privatestaticvoidOnVerifyStarted(Signaturesignature,ProcessStartEventArgsargs){Console.WriteLine("Verify process started at {0} with {1} total signatures to be put in document",args.Started,args.TotalSignatures);}
Implement method for VerifyProgress event
privatestaticvoidOnVerifyProgress(Signaturesignature,ProcessProgressEventArgsargs){Console.WriteLine("Verify progress. Processed {0} signatures. Time spent {1} mlsec",args.ProcessedSignatures,args.Ticks);}
Implement method for VerifyCompleted event
privatestaticvoidOnVerifyCompleted(Signaturesignature,ProcessCompleteEventArgsargs){Console.WriteLine("Verify process completed at {0} with {1} total signatures. Process took {2} mlsec",args.Completed,args.TotalSignatures,args.Ticks);}
Subscribing for verification process events
privatestaticvoidOnVerifyStarted(Signaturesender,ProcessStartEventArgsargs){Console.WriteLine("Verify process started at {0} with {1} total signatures to be put in document",args.Started,args.TotalSignatures);}/// <summary>/// Defines on progress event/// </summary>/// <param name="sender"></param>/// <param name="args"></param>privatestaticvoidOnVerifyProgress(Signaturesender,ProcessProgressEventArgsargs){Console.WriteLine("Verify progress. Processed {0} signatures. Time spent {1} mlsec",args.ProcessedSignatures,args.Ticks);}/// <summary>/// Defines on completed event/// </summary>/// <param name="sender"></param>/// <param name="args"></param>privatestaticvoidOnVerifyCompleted(Signaturesender,ProcessCompleteEventArgsargs){Console.WriteLine("Verify process completed at {0} with {1} total signatures. Process took {2} mlsec",args.Completed,args.TotalSignatures,args.Ticks);}/// <summary>/// Verify document with text signature applying specific options and subscribe for events/// </summary>publicstaticvoidRun(){// The path to the documents directory.stringfilePath=Constants.SAMPLE_PDF;using(Signaturesignature=newSignature(filePath)){signature.VerifyStarted+=OnVerifyStarted;signature.VerifyProgress+=OnVerifyProgress;signature.VerifyCompleted+=OnVerifyCompleted;TextVerifyOptionsoptions=newTextVerifyOptions("John Smith"){AllPages=true};// verify documentVerificationResultresult=signature.Verify(options);if(result.IsValid){Console.WriteLine("\nDocument was verified successfully!");}else{Console.WriteLine("\nDocument failed verification process.");}}}
More resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples: