Search for standard entries in the QR-Code signatures
Search for standard entries in the QR-Code signatures
Leave feedback
On this page
GroupDocs.Signature provides additional features when searching for QrCode Signature that were previously added to document with embedded standard entry objects. Following standard entries are supported to search for and receive object back from Qr-Code
Email that keeps in the QR-code standard email information with recipient, subject and body.
V-Card entry of visit card 3.0 specification with visited card details. More info could be found here.
Me-Card entry implements similar to V-Card contact details standard. More details could be found here.
EPC implements standard of the European Payments Council guidelines define the content of a QR code that can be used to initiate SEPA credit transfer. More details could be found here.
To obtain an entry, call the getData method of the found QrCodeSignature with the entry class, for example getData(Email.class), and check the result for null before using it.
Note
The evaluation version recognizes QR-codes with restrictions and does not return their full text, so getData cannot restore the entry objects. Apply a license to run these examples, see Evaluation Limitations and Licensing.
Search for QR-code signatures and extract Email object
This example shows how to search for QR-code signature and obtain Email object.
// instantiating the signature object
Signaturesignature=newSignature("signed.pdf");try{// search document
List<QrCodeSignature>signatures=signature.search(QrCodeSignature.class,SignatureType.QrCode);for(QrCodeSignatureqrSignature:signatures){System.out.println("Found QRCode signature: "+qrSignature.getEncodeType().getTypeName()+" with text "+qrSignature.getText());Emailemail=qrSignature.getData(Email.class);if(email!=null){System.out.println("Found Email signature: "+email.getAddress()+" "+email.getSubject()+" "+email.getBody());}}}finally{signature.dispose();}
Search for QR-code signatures and extract Address object
This example shows how to search for QR-code signature and obtain Address object.
// instantiating the signature object
Signaturesignature=newSignature("signed.pdf");try{// search document
List<QrCodeSignature>signatures=signature.search(QrCodeSignature.class,SignatureType.QrCode);for(QrCodeSignatureqrSignature:signatures){System.out.println("Found QRCode signature: "+qrSignature.getEncodeType().getTypeName()+" with text "+qrSignature.getText());Addressaddress=qrSignature.getData(Address.class);if(address!=null){System.out.println("Found Address signature: "+address.getCountry()+" "+address.getState()+" "+address.getCity()+" "+address.getZIP());}}}finally{signature.dispose();}
Search for QR-code signatures and extract VCard object
This example shows how to obtain V-Card entry from QR-Code electronic signatures.
// instantiating the signature object
Signaturesignature=newSignature("signed.pdf");try{// search document
List<QrCodeSignature>signatures=signature.search(QrCodeSignature.class,SignatureType.QrCode);for(QrCodeSignatureqrSignature:signatures){System.out.println("Found QRCode signature: "+qrSignature.getEncodeType().getTypeName()+" with text "+qrSignature.getText());VCardvcard=qrSignature.getData(VCard.class);if(vcard!=null){System.out.println("Found VCard signature: "+vcard.getFirstName()+" "+vcard.getLastName()+" from "+vcard.getCompany()+". Email: "+vcard.getEmail());}}}finally{signature.dispose();}
Search for QR-code with MeCard object
This example shows how to obtain Me-Card entry from QR-Code electronic signature.
// instantiating the signature object
Signaturesignature=newSignature("sample.pdf");try{// search document
List<QrCodeSignature>signatures=signature.search(QrCodeSignature.class,SignatureType.QrCode);for(QrCodeSignatureqrSignature:signatures){MeCardmeCard=qrSignature.getData(MeCard.class);if(meCard!=null){System.out.println("Found MeCard signature: "+meCard.getName()+" "+meCard.getReading()+" from "+meCard.getNote()+". Email: "+meCard.getEmail());}else{System.out.println("MeCard object was not found. QRCode "+qrSignature.getEncodeType().getTypeName()+" with text "+qrSignature.getText());}}}finally{signature.dispose();}
Search for QR-code with EPC/SEPA object
This example shows how to obtain EPC/SEPA entry from QR-Code electronic signatures.
// instantiating the signature object
Signaturesignature=newSignature("sample.pdf");try{// search document
List<QrCodeSignature>signatures=signature.search(QrCodeSignature.class,SignatureType.QrCode);for(QrCodeSignatureqrSignature:signatures){EPCpayment=qrSignature.getData(EPC.class);if(payment!=null){System.out.println("Found EPC payment signature. Name "+payment.getName()+", IBAN "+payment.getIBAN()+". Amount "+payment.getAmount()+". Ref: "+payment.getReference()+" / "+payment.getRemittance());}else{System.out.println("EPC object was not found. QRCode "+qrSignature.getEncodeType().getTypeName()+" with text "+qrSignature.getText());}}}finally{signature.dispose();}
Search for QR-code with Event object
This example shows how to obtain Event entry from QR-Code electronic signatures.
// instantiating the signature object
Signaturesignature=newSignature("sample.pdf");try{// search document
List<QrCodeSignature>signatures=signature.search(QrCodeSignature.class,SignatureType.QrCode);for(QrCodeSignatureqrSignature:signatures){Eventevnt=qrSignature.getData(Event.class);if(evnt!=null){System.out.println("Found Event signature: "+evnt.getTitle()+"/"+evnt.getDescription()+" at "+evnt.getLocation()+". Started @ "+evnt.getStartDate());}else{System.out.println("Event object was not found. QRCode "+qrSignature.getEncodeType().getTypeName()+" with text "+qrSignature.getText());}}}finally{signature.dispose();}
More resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples: