Search for standard entries in the QR-Code signatures

GroupDocs.SignatureΒ provides additional featuresΒ when searching forQrCode 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.
  • Address with address information.
  • 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.
  • Event entry implements event standard.
  • WiFi entry implements WiFI settings standard.
  • SMS entry implements sms properties.
  • CryptoCurrencyTransfer entry implements event standard.

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
using (Signature signature = new Signature("signed.pdf"))
{
    // search document
    List<QrCodeSignature> signatures = signature.Search<QrCodeSignature>(SignatureType.QrCode);
    foreach (QrCodeSignature qrSignature in signatures)
    {
        Console.WriteLine("Found QRCode signature: {0} with text {1}", qrSignature.EncodeType.TypeName, qrSignature.Text);
        Email email = qrSignature.GetData<Email>();
        if (email != null)
        {
           Console.WriteLine($"Found Email signature: {email.Address} {email.Subject} {email.Body}");
        }
    }
}

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
using (Signature signature = new Signature("signed.pdf"))
{
    // search document
    List<QrCodeSignature> signatures = signature.Search<QrCodeSignature>(SignatureType.QrCode);
    foreach (QrCodeSignature qrSignature in signatures)
    {
        Console.WriteLine("Found QRCode signature: {0} with text {1}", qrSignature.EncodeType.TypeName, qrSignature.Text);
        Address Address = qrSignature.GetData<Address>();
        if (Address != null)
        {
            Console.WriteLine($"Found Address signature: {Address.Country} {Address.State} {Address.City} {Address.ZIP}");
        }
     }
}

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
using (Signature signature = new Signature("signed.pdf"))
{
    // search document
    List<QrCodeSignature> signatures = signature.Search<QrCodeSignature>(SignatureType.QrCode);
 foreach (QrCodeSignature qrSignature in signatures)
    {
        Console.WriteLine("Found QRCode signature: {0} with text {1}", qrSignature.EncodeType.TypeName, qrSignature.Text);
        VCard vcard = qrSignature.GetData<VCard>();
        if (vcard != null)
        {
            Console.WriteLine("Found VCard signature: {0} {1} from {2}. Email: {3}", vcard.FirstName, vcard.LastName, vcard.Company, vcard.Email);
        }
    }
}

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
using (Signature signature = new Signature("sample.pdf"))
{
    // search document
    List<QrCodeSignature> signatures = signature.Search<QrCodeSignature>(SignatureType.QrCode);
    try
    {
        foreach (QrCodeSignature qrSignature in signatures)
        {
            MeCard meCard = qrSignature.GetData<MeCard>();
            if (meCard != null)
            {
                Console.WriteLine("Found MeCard signature: {0} {1} from {2}. Email: {3}", meCard.Name, meCard.Reading, meCard.Note, meCard.Email);
            }
            else
            {
                Helper.WriteError($"MeCard object was not found. QRCode {qrSignature.EncodeType.TypeName} with text {qrSignature.Text}");
            }
        }
    }
    catch
    {
        Console.WriteError("\nThis example requires license to properly run. " +
                      "\nVisit the GroupDocs site to obtain either a temporary or permanent license. " +
                      "\nLearn more about licensing at https://purchase.groupdocs.com/faqs/licensing. " +
                      "\nLear how to request temporary license at https://purchase.groupdocs.com/temporary-license.");
    }
}

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
using (Signature signature = new Signature("sample.pdf"))
{
    // search document
    List<QrCodeSignature> signatures = signature.Search<QrCodeSignature>(SignatureType.QrCode);
    try
    {
        foreach (QrCodeSignature qrSignature in signatures)
        {
            EPC payment = qrSignature.GetData<EPC>();
            if (payment != null)
            {
                Console.WriteLine($"Found EPC payment signature. Name {payment.Name}, IBAN {payment.IBAN}. Amount {payment.Amount}. Ref: {payment.Reference} / {payment.Remittance}");
            }
            else
            {
                Helper.WriteError($"EPC object was not found. QRCode {qrSignature.EncodeType.TypeName} with text {qrSignature.Text}");
            }
        }
    }
    catch
    {
        Console.WriteError("\nThis example requires license to properly run. " +
                      "\nVisit the GroupDocs site to obtain either a temporary or permanent license. " +
                      "\nLearn more about licensing at https://purchase.groupdocs.com/faqs/licensing. " +
                      "\nLear how to request temporary license at https://purchase.groupdocs.com/temporary-license.");
    }
}

Search for QR-code with Event object

This example shows how to obtainΒ Event entry from QR-Code electronic signatures.

// instantiating the signature object
using (Signature signature = new Signature("sample.pdf"))
{
    // search document
    List<QrCodeSignature> signatures = signature.Search<QrCodeSignature>(SignatureType.QrCode);
    try
    {
        foreach (QrCodeSignature qrSignature in signatures)
        {
            Event evnt = qrSignature.GetData<Event>();
            if (evnt != null)
            {
                Console.WriteLine($"Found Event signature: {evnt.Title}/{evnt.Description} at {evnt.Location}. Started @ {evnt.StartDate}");
            }
            else
            {
                Helper.WriteError($"Event object was not found. QRCode {qrSignature.EncodeType.TypeName} with text {qrSignature.Text}");
            }
        }
    }
    catch
    {
        Console.WriteError("\nThis example requires license to properly run. " +
                      "\nVisit the GroupDocs site to obtain either a temporary or permanent license. " +
                      "\nLearn more about licensing at https://purchase.groupdocs.com/faqs/licensing. " +
                      "\nLear how to request temporary license at https://purchase.groupdocs.com/temporary-license.");
    }
}

More resources

GitHub Examples

You may easily run the code above and see the feature in action in ourΒ GitHub examples:

Free Online Apps

Along with the full-featured .NET library, we provide simple but powerful free online apps.

To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the GroupDocs.Signature App Product Family.