ElBruno.QRCodeGenerator.CLI
1.1.0
dotnet add package ElBruno.QRCodeGenerator.CLI --version 1.1.0
NuGet\Install-Package ElBruno.QRCodeGenerator.CLI -Version 1.1.0
<PackageReference Include="ElBruno.QRCodeGenerator.CLI" Version="1.1.0" />
<PackageVersion Include="ElBruno.QRCodeGenerator.CLI" Version="1.1.0" />
<PackageReference Include="ElBruno.QRCodeGenerator.CLI" />
paket add ElBruno.QRCodeGenerator.CLI --version 1.1.0
#r "nuget: ElBruno.QRCodeGenerator.CLI, 1.1.0"
#:package ElBruno.QRCodeGenerator.CLI@1.1.0
#addin nuget:?package=ElBruno.QRCodeGenerator.CLI&version=1.1.0
#tool nuget:?package=ElBruno.QRCodeGenerator.CLI&version=1.1.0
ElBruno.QRCodeGenerator
A family of .NET libraries for QR code generation 🟦
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.
Packages
ElBruno.QRCodeGenerator.CLI
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.
Features
- 🎯 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
Installation
dotnet add package ElBruno.QRCodeGenerator.CLI
Quick Start
Print to Console
using ElBruno.QRCodeGenerator.CLI;
// Simplest possible usage
QRCode.Print("https://github.com/elbruno");
Get QR Code as String
using ElBruno.QRCodeGenerator.CLI;
// Generate QR code and capture as string
string qrCode = QRCode.Generate("Hello, World!");
Console.WriteLine(qrCode);
Samples
See src/samples/BasicQRCode for the complete CLI example.
ElBruno.QRCodeGenerator.Payloads
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.
Installation
dotnet add package ElBruno.QRCodeGenerator.Payloads
Quick Start
using 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
ElBruno.QRCodeGenerator.Svg
Generate resolution-independent SVG QR codes
Installation
dotnet add package ElBruno.QRCodeGenerator.Svg
Quick Start
using 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
ElBruno.QRCodeGenerator.Image
Generate PNG, JPEG, and WebP QR code bitmaps using SkiaSharp
Installation
dotnet add package ElBruno.QRCodeGenerator.Image
Quick Start
using 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
ElBruno.QRCodeGenerator.Ascii
Generate QR codes as ASCII art text
Installation
dotnet add package ElBruno.QRCodeGenerator.Ascii
Quick Start
using 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
ElBruno.QRCodeGenerator.Pdf
Embed QR codes in PDF documents
Installation
dotnet add package ElBruno.QRCodeGenerator.Pdf
Quick Start
using 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
ElBruno.QRCodeGenerator.Tool
qrgen — global dotnet tool for all QR code formats
Installation
dotnet tool install -g ElBruno.QRCodeGenerator.Tool
Quick Start
# 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"
Building from Source
git clone https://github.com/elbruno/ElBruno.QRCodeGenerator.git
cd ElBruno.QRCodeGenerator
dotnet build
dotnet test
Documentation
- 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
License
MIT License - see LICENSE for details.
Author
👤 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
Acknowledgments
Built with QRCoder — the most popular .NET QR encoder.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- QRCoder (>= 1.6.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release with console QR code generation using Unicode block characters.