privatestaticvoidonVerifyStarted(Signaturesender,ProcessStartEventArgsargs){System.out.print("Verify process started at "+args.getStarted()+" with "+args.getTotalSignatures()+" total signatures to be put in document");}
Implement method for VerifyProgress event
privatestaticvoidonVerifyProgress(Signaturesender,ProcessProgressEventArgsargs){System.out.print("Verify progress. Processed "+args.getProcessedSignatures()+" signatures. Time spent "+args.getTicks()+" mlsec");}
Implement method for VerifyCompleted event
privatestaticvoidonVerifyCompleted(Signaturesender,ProcessCompleteEventArgsargs){System.out.print("Verify process completed at "+args.getCompleted()+" with "+args.getTotalSignatures()+" total signatures. Process took "+args.getTicks()+" mlsec");}
Subscribing for verification process events
privatestaticvoidonVerifyStarted(Signaturesender,ProcessStartEventArgsargs){System.out.print("Verify process started at "+args.getStarted()+" with "+args.getTotalSignatures()+" total signatures to be put in document");}privatestaticvoidonVerifyProgress(Signaturesender,ProcessProgressEventArgsargs){System.out.print("Verify progress. Processed "+args.getProcessedSignatures()+" signatures. Time spent "+args.getTicks()+" mlsec");}privatestaticvoidonVerifyCompleted(Signaturesender,ProcessCompleteEventArgsargs){System.out.print("Verify process completed at "+args.getCompleted()+" with "+args.getTotalSignatures()+" total signatures. Process took "+args.getTicks()+" mlsec");}publicstaticvoidrun(){try{Signaturesignature=newSignature("sample.pdf");signature.VerifyStarted.add(newProcessStartEventHandler(){publicvoidinvoke(Signaturesender,ProcessStartEventArgsargs){onVerifyStarted(sender,args);}});signature.VerifyProgress.add(newProcessProgressEventHandler(){publicvoidinvoke(Signaturesender,ProcessProgressEventArgsargs){onVerifyProgress(sender,args);}});signature.VerifyCompleted.add(newProcessCompleteEventHandler(){publicvoidinvoke(Signaturesender,ProcessCompleteEventArgsargs){onVerifyCompleted(sender,args);}});TextVerifyOptionsoptions=newTextVerifyOptions("John Smith");options.setAllPages(true);// verify document
VerificationResultresult=signature.verify(options);if(result.isValid()){System.out.print("\nDocument was verified successfully!");}else{System.out.print("\nDocument failed verification process.");}}catch(Exceptione){thrownewGroupDocsSignatureException(e.getMessage());}}
More resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples:
Along with full-featured .NET library we provide simple, but powerful free Apps. You are welcome to eSign PDF, Word, Excel, PowerPoint documents with free to use online GroupDocs Signature App.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.