privatestaticvoidonSearchStarted(Signaturesender,ProcessStartEventArgsargs){System.out.print("Search process started at "+args.getStarted()+" with "+args.getTotalSignatures()+" total signatures to be put in document");}
Implement method for SearchProgress event
privatestaticvoidonSearchProgress(Signaturesender,ProcessProgressEventArgsargs){System.out.print("Search progress. Processed "+args.getProcessedSignatures()+" signatures. Time spent "+args.getTicks()+" mlsec");}
Implement method for SearchCompleted event
privatestaticvoidonSearchCompleted(Signaturesender,ProcessCompleteEventArgsargs){System.out.print("Search process completed at "+args.getCompleted()+" with "+args.getTotalSignatures()+" total signatures. Process took "+args.getTicks()+" mlsec");}
Subscribing for search process events
privatestaticvoidonSearchStarted(Signaturesender,ProcessStartEventArgsargs){System.out.print("Search process started at "+args.getStarted()+" with "+args.getTotalSignatures()+" total signatures to be put in document");}privatestaticvoidonSearchProgress(Signaturesender,ProcessProgressEventArgsargs){System.out.print("Search progress. Processed "+args.getProcessedSignatures()+" signatures. Time spent "+args.getTicks()+" mlsec");}privatestaticvoidonSearchCompleted(Signaturesender,ProcessCompleteEventArgsargs){System.out.print("Search process completed at "+args.getCompleted()+" with "+args.getTotalSignatures()+" total signatures. Process took "+args.getTicks()+" mlsec");}publicstaticvoidrun(){// The path to the documents directory.
StringfilePath=Constants.SAMPLE_PDF;try{Signaturesignature=newSignature(filePath);signature.SearchStarted.add(newProcessStartEventHandler(){publicvoidinvoke(Signaturesender,ProcessStartEventArgsargs){onSearchStarted(sender,args);}});signature.SearchProgress.add(newProcessProgressEventHandler(){publicvoidinvoke(Signaturesender,ProcessProgressEventArgsargs){onSearchProgress(sender,args);}});signature.SearchCompleted.add(newProcessCompleteEventHandler(){publicvoidinvoke(Signaturesender,ProcessCompleteEventArgsargs){onSearchCompleted(sender,args);}});BarcodeSearchOptionsoptions=newBarcodeSearchOptions();// specify special pages to search on
options.setAllPages(false);// search for signatures in document
List<BarcodeSignature>signatures=signature.search(BarcodeSignature.class,options);System.out.print("\nSource document contains following signatures.");for(BarcodeSignaturebarcodeSignature:signatures){System.out.print("Barcode signature found at page "+barcodeSignature.getPageNumber()+" with type "+barcodeSignature.getEncodeType()+" and text "+barcodeSignature.getText());}}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.