Sign documents with standard QR Code entries
Leave feedback
On this page
GroupDocs.Signature provides ability to embed into QR-code signature standard entries like email, contact v-card, address etc. This feature supports standard QR-code representation of entries. At this moment following standard QR-code entries are supported
Email entry that allows to specify in QR-code standard email information with recipient, subject and body.
V-Card entry implements standard of visit card 3.0 specification. More details 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.
This example shows how to esign PDF with Email QR-code object.
using(Signaturesignature=newSignature("sample.pdf")){// create Email objectvaremail=newEmail(){Address="sherlock@holmes.com",Subject="Very important e-mail",Body="Hello, Watson. Reach me ASAP!"};// create optionsvaroptions=newQrCodeSignOptions{EncodeType=QrCodeTypes.QR,// setup Data property to Address instanceData=email,// set right bottom cornerHorizontalAlignment=HorizontalAlignment.Right,VerticalAlignment=VerticalAlignment.Bottom,Width=100,Height=100,Margin=newPadding(10)};// sign document to filesignature.Sign("output.pdf",options);}
Sign PDF with Address inside the QR-Code image
This example shows how to esign PDF with address inside the QR-code image.
using(Signaturesignature=newSignature("sample.pdf")){// create Address objectvaraddress=newAddress(){Street="221B Baker Street",City="London",State="NW",ZIP="NW16XE",Country="England"};// create optionsvaroptions=newQrCodeSignOptions{EncodeType=QrCodeTypes.QR,// setup Data property to Address instanceData=address,// set right bottom cornerHorizontalAlignment=HorizontalAlignment.Right,VerticalAlignment=VerticalAlignment.Bottom,Margin=newPadding(10),Width=100,Height=100,};// sign document to filesignature.Sign("output.pdf",options);}
Sign PDF with V-Card (VCF) information in the QR-Code image
This example shows how to esign PDF with V-Card inside the QR-code image.
using(Signaturesignature=newSignature("sample.pdf")){// create VCard objectvarvCard=newVCard(){FirstName="Sherlock",MidddleName="Jay",LastName="Holmes",Initials="Mr.",Company="Watson Inc.",JobTitle="Detective",HomePhone="0333 003 3577",WorkPhone="0333 003 3512",Email="watson@sherlockholmes.com",Url="http://sherlockholmes.com/",BirthDay=newDateTime(1854,1,6),HomeAddress=newAddress(){Street="221B Baker Street",City="London",State="NW",ZIP="NW16XE",Country="England"}};// create optionsvaroptions=newQrCodeSignOptions{EncodeType=QrCodeTypes.QR,// setup Data property to Address instanceData=vCard,// set right bottom cornerHorizontalAlignment=HorizontalAlignment.Right,VerticalAlignment=VerticalAlignment.Bottom,Width=100,Height=100,Margin=newPadding(10)};// sign document to filesignature.Sign("output.pdf",options);}
Sign PDF with Me-Card information in the QR-Code image
This example shows how to esign PDF with Me-Card inside the QR-code image.
using(Signaturesignature=newSignature("sample.pdf")){// create MeCard objectMeCardcard=newMeCard(){Name="Sherlock",Nickname="Jay",Reading="Holmes",Note="Base Detective",Phone="0333 003 3577",AltPhone="0333 003 3512",Email="watson@sherlockholmes.com",Url="http://sherlockholmes.com/",BirthDay=newDateTime(1854,1,6),Address=newAddress(){Street="221B Baker Street",City="London",State="NW",ZIP="NW16XE",Country="England"}};// create optionsQrCodeSignOptionsoptions=newQrCodeSignOptions{EncodeType=QrCodeTypes.QR,// setup Data property to Address instanceData=card,// set right bottom cornerHorizontalAlignment=HorizontalAlignment.Right,VerticalAlignment=VerticalAlignment.Bottom,Width=100,Height=100,Margin=newPadding(10)};// sign document to filesignature.Sign("output.pdf",options);}
Sign PDF with EPC payment in the QR-Code image
This example shows how to esign PDF with EPC / SEPA payment inside the QR-code image.
using(Signaturesignature=newSignature("sample.pdf")){// create EPC objectEPCepc=newEPC(){Name="Sherlock",BIC="MrSherlockH",IBAN="BE72000000001616",Amount=123456.78D,Code="SHRL",Reference="Private service",Information="Thanks for help"};// create optionsQrCodeSignOptionsoptions=newQrCodeSignOptions{EncodeType=QrCodeTypes.QR,// setup Data property to Address instanceData=epc,// set right bottom cornerHorizontalAlignment=HorizontalAlignment.Right,VerticalAlignment=VerticalAlignment.Bottom,Width=100,Height=100,Margin=newPadding(10)};// sign document to filesignature.Sign("output.pdf",options);}
Sign PDF with Event information in the QR-Code image
This example shows how to esign PDF with event data inside the QR-code image.
using(Signaturesignature=newSignature("sample.pdf")){// create Event objectEventevnt=newEvent(){Title="GTM(9-00)",Description="General Team Meeting",Location="Conference-Room",StartDate=DateTime.Now.Date.AddDays(1).AddHours(9),EndDate=DateTime.Now.Date.AddDays(1).AddHours(9).AddMinutes(30)};// create optionsQrCodeSignOptionsoptions=newQrCodeSignOptions{EncodeType=QrCodeTypes.QR,// setup Data property to Address instanceData=evnt,// set right bottom cornerHorizontalAlignment=HorizontalAlignment.Right,VerticalAlignment=VerticalAlignment.Bottom,Width=100,Height=100,Margin=newPadding(10)};// sign document to filesignature.Sign("output.pdf",options);}
Sign PDF with CryptoCurrencyTransfer information in the QR-Code image
This example shows how to esign PDF with Cryptocurrency transfer data inside the QR-code image.
using(Signaturesignature=newSignature("sample.pdf")){// create crypto currency objectCryptoCurrencyTransfertransfer=newCryptoCurrencyTransfer(){Type=CryptoCurrencyType.Bitcoin,Address="1JHG2qjdk5Khiq7X5xQrr1wfigepJEK3t",Amount=1234.56M,Message="Consulting services"};// create alternative crypto currency objectCryptoCurrencyTransfercustomTransfer=newCryptoCurrencyTransfer(){Type=CryptoCurrencyType.Custom,CustomType=@"SuperCoin",Address=@"15N3yGu3UFHeyUNdzQ5sS3aRFRzu5Ae7EZ",Amount=6543.21M,Message=@"Accounting services"};// create QR-code optionsQrCodeSignOptionsoptions1=newQrCodeSignOptions{// setup Data property to Address instanceData=transfer,Left=10,Top=10,};// create alternative QR-code optionsQrCodeSignOptionsoptions2=newQrCodeSignOptions{// setup Data property to Address instanceData=customTransfer,Left=10,Top=200};List<SignOptions>listOptions=newList<SignOptions>(){options1,options2};// sign document to filesignature.Sign("output.pdf",options);}
Create an image with the WiFi QR Code information
This example shows how to create an image with the WiFi QR Code object.
using(Signaturesignature=newSignature("sample.png")){// create WiFi objectWiFiwifi=newWiFi(){SSID="GuestNetwork!",Encryption=WiFiEncryptionType.WPAWPA2,Password="guest",Hidden=false};// create optionsQrCodeSignOptionsoptions=newQrCodeSignOptions{EncodeType=QrCodeTypes.QR,// setup Data property to WiFi object instanceData=wifi,// set right bottom cornerHorizontalAlignment=HorizontalAlignment.Right,VerticalAlignment=VerticalAlignment.Bottom,Width=100,Height=100,Margin=newPadding(10)};// sign document to image filesignature.Sign("output.png",options);}
Sign PDF with SMS data information in the QR-Code
This example shows how to esign PDF with QR Code SMS data on the PDF page. This could be used for automatic document verification or subscription.
using(Signaturesignature=newSignature("sample.pdf")){// create SMS objectSMSsms=newSMS(){Number="0800 048 0408",Message="Document approval automatic SMS message"};// create optionsQrCodeSignOptionsoptions=newQrCodeSignOptions{EncodeType=QrCodeTypes.QR,// setup Data property to Address instanceData=sms,// set right bottom cornerHorizontalAlignment=HorizontalAlignment.Right,VerticalAlignment=VerticalAlignment.Bottom,Width=100,Height=100,Margin=newPadding(10)};// sign document to filesignature.Sign("output.pdf",options);}
More resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples: