Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Last active October 2, 2023 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save GroupDocsGists/4c70c60f1f5bdfce19da18f8b9f6ca11 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/4c70c60f1f5bdfce19da18f8b9f6ca11 to your computer and use it in GitHub Desktop.
Add QR Code to PDF, Excel, PPT, Word Documents, and Images in C#
// Change Appearance of QR code in C#
// Setting background color, forecolor, transparency, etc.
Background = new Background()
{
Color = Color.Black,
Transparency = 0.5
},
//set text color and Font
ForeColor = Color.White
// Electronically Sign PDF, Excel, PPT, Word Documents and Images with QR Code using GroupDocs.Signature for .NET API
using (Signature signature = new Signature("filePath/document.pdf")) // Provide any DOC, PDF, XLS, PPT, PNG, JPG, WebP file.
{
// Create QR Code option with predefined text
QrCodeSignOptions options = new QrCodeSignOptions("Signed by GroupDocs")
{
EncodeType = QrCodeTypes.QR,
// Set QR Code position & appearance
Left = 50,
Top = 50,
Width = 90,
Height = 90
};
// Sign document and save file
SignResult result = signature.Sign("filePath/document-with-qr-code.pdf", options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment