Get Started - Generate a QR Code
- 2 minutes to read
Important
You need a license for the DevExpress Office & PDF File API Subscription or DevExpress Universal Subscription to use these examples in production code.
This tutorial uses DevExpress.Docs.Barcode API to generate a QR Code image a .NET application.
Typical Barcode Generation Workflow
- Choose symbology from the supported barcode list.
- Configure common options (colors, layout, DPI, module size).
- Set symbology-specific options (for example, QR Code error correction).
- Export a barcode image and embed it in your application or documents.
Create a .NET Application and Generate a QR Code
This section follows the workflow above to generate the following barcode:

Create a new Console App project for .NET 8 or later.
Install the DevExpress.Docs.Barcode NuGet package.
Open the Program.cs (Module1.vb) file. Paste the code below in the Main method of the Program class (Main procedure of the Module1 module in Visual Basic):
using System.IO; using DevExpress.Docs.Barcode; using DevExpress.Drawing; // Choose a symbology var qrOptions = new QRCodeOptions(); // Configure common options qrOptions.Dpi = 96; qrOptions.ModuleSize = 2f; qrOptions.ShowText = false; // Configure QR Code-specific options qrOptions.CompactionMode = QRCodeCompactionMode.Byte; qrOptions.ErrorCorrectionLevel = QRCodeErrorCorrectionLevel.Q; // Export the barcode image using var output = new FileStream("BarCodeImage.png", FileMode.Create, FileAccess.Write); using var generator = new BarcodeGenerator(qrOptions); generator.Export("https://www.devexpress.com", output, DXImageFormat.Png);Run the project. The image is saved as BarCodeImage.png.
Next Steps
- Bar Code Types
- Bar Code Options
- Bar Code Recognition Specifics
- Migrate from Legacy Barcode Generation API
See Also