id: verify-qr-code-signatures
url: signature/net/verify-qr-code-signatures
title: Verifying QR Code signatures in advance
weight: 2
description: " This article explains how to provide advanced verification of QR Code electronic signatures with GroupDocs.Signature API."
keywords:
productName: GroupDocs.Signature for .NET
toc: True
structuredData:
showOrganization: True
application: name: Verify QR code signature in documents using C# description: This article explains how to scan the document for QR Code and provide its verification with C# language and GroupDocs.Signature for .NET APIs
productCode: signature
productPlatform: net
showVideo: True
howTo:
name: How to scan QR Code and verify the document for specific QR Code entities using C#
description: This topic explains how to verify the document for QR Code, provide QR Code verification and validation in C#
steps:
- name: Load document for verification from the local file or stream.
text: Create Signature class instance by passing either local or network file path or stream.
- name: Provide QR Code verification options.
text: Set demanded data of the QRCodeVerifyOptions instance to specify optionally QR Code type or text.
- name: Run verification
text: Call the Verify method with passing verification options and keep the verification process result.
- name: Analyse verification result
text: Check verification result for its state and verification details.
Here are the steps to verify QR Code signature within the document with GroupDocs.Signature:
Create new instance of Signature class and pass source document path as a constructor parameter.
*Instantiate the QrCodeVerifyOptions object according to your requirements and specify verification options
This example shows how to verify QR Code signature in the document. See VerificationResult
using(Signaturesignature=newSignature("sample.pdf")){QrCodeVerifyOptionsoptions=newQrCodeVerifyOptions(){// specify if all pages should be verifiedAllPages=false,PagesSetup=newPagesSetup(){FirstPage=false,LastPage=true,OddPages=false,EvenPages=true},// specify text patternText="John",// specify verification text patternMatchType=TextMatchType.Contains,// specify types of QR code to verifyEncodeType=QrCodeTypes.QR};// verify document signaturesVerificationResultresult=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: