ElBruno.QRCodeGenerator is a suite of .NET libraries for generating QR codes in various formats β from console rendering to image generation. Built for developers who need flexible, easy-to-use QR code tools.
Generate and display QR codes in the console using Unicode block characters
The CLI package is a lightweight .NET library that creates beautiful QR codes in your terminal with Unicode block characters. Perfect for CLI tools, server logs, and terminal applications.
- π― Simple API - Generate QR codes with one line of code:
QRCode.Print("your text") - π₯οΈ Console-Optimized - Uses Unicode block characters for perfect 2:1 aspect ratio in terminals
- π¨ Theme Support - Built-in light/dark theme support with color inversion
- π¦ Multi-Target - .NET 8.0 and .NET 10.0 support
- β Battle-Tested - Built on QRCoder, the most popular .NET QR encoder
- π§ Configurable - Adjust error correction, quiet zone, and rendering options
dotnet add package ElBruno.QRCodeGenerator.CLIusing ElBruno.QRCodeGenerator.CLI;
// Simplest possible usage
QRCode.Print("https://github.com/elbruno");using ElBruno.QRCodeGenerator.CLI;
// Generate QR code and capture as string
string qrCode = QRCode.Generate("Hello, World!");
Console.WriteLine(qrCode);See src/samples/BasicQRCode for the complete CLI example.
Fluent payload builders for WiFi, vCard, Email, SMS, Geo, and URL QR codes
Zero external dependencies β pure string formatting that works with any QR code renderer.
dotnet add package ElBruno.QRCodeGenerator.Payloadsusing ElBruno.QRCodeGenerator.Payloads;
// WiFi network QR code
var wifi = PayloadBuilder.Wifi("MyNetwork", "MyPassword123");
Console.WriteLine(wifi.GetPayloadString());
// Output: WIFI:T:WPA;S:MyNetwork;P:MyPassword123;;
// vCard contact
var vcard = PayloadBuilder.VCard("Bruno Capuano")
.WithPhone("+1234567890", VCardPhoneType.Mobile)
.WithEmail("bruno@example.com", VCardEmailType.Work)
.WithOrganization("Contoso");
Console.WriteLine(vcard.GetPayloadString());
// Combine with any renderer (e.g., CLI)
QRCode.Print(wifi.GetPayloadString());π Full Payloads sample | π API Reference
Generate resolution-independent SVG QR codes
dotnet add package ElBruno.QRCodeGenerator.Svgusing ElBruno.QRCodeGenerator.Svg;
// Generate an SVG QR code
var svg = SvgQRCode.Generate("https://github.com/elbruno");
File.WriteAllText("qrcode.svg", svg);
// Custom colors and sizing
var customSvg = SvgQRCode.Generate("Hello, World!", svgOptions: new SvgOptions
{
ForegroundColor = "#003366",
BackgroundColor = "#f0f0f0",
ModuleSize = 8
});π Full SVG sample | π API Reference
Generate PNG, JPEG, and WebP QR code bitmaps using SkiaSharp
dotnet add package ElBruno.QRCodeGenerator.Imageusing ElBruno.QRCodeGenerator.Image;
// Save as PNG
byte[] png = ImageQRCode.ToPng("https://github.com/elbruno");
File.WriteAllBytes("qrcode.png", png);
// Save as JPEG with custom quality
byte[] jpg = ImageQRCode.ToJpeg("Hello, World!", quality: 90);
File.WriteAllBytes("qrcode.jpg", jpg);π Full Image sample | π API Reference
Generate QR codes as ASCII art text
dotnet add package ElBruno.QRCodeGenerator.Asciiusing ElBruno.QRCodeGenerator.Ascii;
// Default block style
AsciiQRCode.Print("https://github.com/elbruno");
// Hash style for text files
var ascii = AsciiQRCode.Generate("Hello!", asciiOptions: new AsciiOptions
{
Style = AsciiStyle.Hash
});
File.WriteAllText("qrcode.txt", ascii);π Full ASCII sample | π API Reference
Embed QR codes in PDF documents
dotnet add package ElBruno.QRCodeGenerator.Pdfusing ElBruno.QRCodeGenerator.Pdf;
// Generate a PDF with a QR code
PdfQRCode.Save("https://github.com/elbruno", "qrcode.pdf");
// With title and custom options
PdfQRCode.Save("https://github.com/elbruno", "styled.pdf", pdfOptions: new PdfOptions
{
Title = "Scan Me!",
ModuleSize = 3.0
});π Full PDF sample | π API Reference
qrgen β global dotnet tool for all QR code formats
dotnet tool install -g ElBruno.QRCodeGenerator.Tool# Console output (default)
qrgen "https://github.com/elbruno"
# Save as SVG
qrgen "Hello World" --format svg --output hello.svg
# Save as PNG with custom colors
qrgen "Hello" --format png --output hello.png --fg "#003366" --bg "#f0f0f0"
# ASCII art
qrgen "Hello" --format ascii --ascii-style dot
# PDF with title
qrgen "https://example.com" --format pdf --output qr.pdf --title "Scan Me"git clone https://github.com/elbruno/ElBruno.QRCodeGenerator.git
cd ElBruno.QRCodeGenerator
dotnet build
dotnet test- API Reference - Complete API documentation and configuration examples
- Publishing Guide - How to publish to NuGet (trusted publishing via OIDC)
- Changelog - Version history and release notes
MIT License - see LICENSE for details.
π€ Bruno Capuano (ElBruno)
- Blog: https://elbruno.com
- YouTube: https://youtube.com/@inthelabs
- LinkedIn: https://linkedin.com/in/inthelabs
- Twitter: https://twitter.com/inthelabs
- Podcast: https://inthelabs.dev
Built with QRCoder β the most popular .NET QR encoder.