QRCoder.Core
2.0.0
.NET 8.0
This package targets .NET 8.0. The package is compatible with this framework or higher.
.NET Standard 2.1
This package targets .NET Standard 2.1. The package is compatible with this framework or higher.
.NET Framework 4.8
This package targets .NET Framework 4.8. The package is compatible with this framework or higher.
dotnet add package QRCoder.Core --version 2.0.0
NuGet\Install-Package QRCoder.Core -Version 2.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="QRCoder.Core" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="QRCoder.Core" Version="2.0.0" />Directory.Packages.props
<PackageReference Include="QRCoder.Core" />Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add QRCoder.Core --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: QRCoder.Core, 2.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package QRCoder.Core@2.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=QRCoder.Core&version=2.0.0Install as a Cake Addin
#tool nuget:?package=QRCoder.Core&version=2.0.0Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
QRCoder.Core
A cross-platform .NET library for QR Code generation using SkiaSharp. Compatible with Windows, Linux, macOS, and mobile (Xamarin / MAUI).
Based on QRCoder. Supports .NET Standard 2.1, .NET 8.0, .NET 10.0, and .NET Framework 4.8.
Quick Start
using QRCoder.Core;
// Generate QR code data
using var generator = new QRCodeGenerator();
using var data = generator.CreateQrCode("https://github.com/afonsoft/QRCoder.Core",
QRCodeGenerator.ECCLevel.M);
// Render as PNG bytes (cross-platform, no System.Drawing needed)
using var png = new PngByteQRCode(data);
byte[] pngBytes = png.GetGraphic(10);
File.WriteAllBytes("qrcode.png", pngBytes);
Output Formats
| Format | Class | Example |
|---|---|---|
| PNG | PngByteQRCode |
new PngByteQRCode(data).GetGraphic(10) → byte[] |
| SVG | SvgQRCode |
new SvgQRCode(data).GetGraphic(10) → string |
PdfByteQRCode |
new PdfByteQRCode(data).GetGraphic(5) → byte[] |
|
| ASCII | ASCIIQRCode |
new ASCIIQRCode(data).GetGraphic(1) → string |
| Base64 | Base64QRCode |
new Base64QRCode(data).GetGraphic(10) → string |
| SKBitmap | QRCode |
new QRCode(data).GetGraphic(10) → SKBitmap |
| Postscript | PostscriptQRCode |
new PostscriptQRCode(data).GetGraphic(5) → string |
| Artistic | ArtQRCode |
new ArtQRCode(data).GetGraphic(10) → SKBitmap |
| BMP | BitmapByteQRCode |
new BitmapByteQRCode(data).GetGraphic(10) → byte[] |
Multiple Formats Example
using QRCoder.Core;
using var gen = new QRCodeGenerator();
using var data = gen.CreateQrCode("Hello World", QRCodeGenerator.ECCLevel.M);
// SVG
using var svg = new SvgQRCode(data);
string svgString = svg.GetGraphic(10);
// ASCII (terminal)
using var ascii = new ASCIIQRCode(data);
Console.WriteLine(ascii.GetGraphic(1));
// PDF
using var pdf = new PdfByteQRCode(data);
byte[] pdfBytes = pdf.GetGraphic(5);
// With custom colors
using var qr = new QRCode(data);
using var bitmap = qr.GetGraphic(10, "#1a1a2e", "#e0e0e0");
Payload Types
Generate formatted QR code content for common use cases:
using QRCoder.Core;
using var gen = new QRCodeGenerator();
// Wi-Fi
var wifi = new PayloadGenerator.WiFi("MyNetwork", "MyPassword",
PayloadGenerator.WiFi.Authentication.WPA);
using var wifiData = gen.CreateQrCode(wifi.ToString(), QRCodeGenerator.ECCLevel.M);
// URL
var url = new PayloadGenerator.Url("https://github.com/afonsoft/QRCoder.Core");
using var urlData = gen.CreateQrCode(url.ToString(), QRCodeGenerator.ECCLevel.M);
// Email
var mail = new PayloadGenerator.Mail("test@example.com", "Subject", "Body");
using var mailData = gen.CreateQrCode(mail.ToString(), QRCodeGenerator.ECCLevel.M);
// Phone Number
var phone = new PayloadGenerator.PhoneNumber("+1234567890");
using var phoneData = gen.CreateQrCode(phone.ToString(), QRCodeGenerator.ECCLevel.M);
// Contact Card (vCard)
var contact = new PayloadGenerator.ContactData(
PayloadGenerator.ContactData.ContactOutputType.VCard3,
"Doe", "John", phone: "+1234567890", email: "john@example.com");
using var contactData = gen.CreateQrCode(contact.ToString(), QRCodeGenerator.ECCLevel.M);
Supported payloads: URL, WiFi, Mail, SMS, PhoneNumber, MMS, Geolocation, CalendarEvent, ContactData, Bitcoin, Girocode, BezahlCode, SwissQrCode, OneTimePassword, ShadowSocksConfig, Bookmark, SkypeCall, WhatsAppMessage, and more.
Error Correction Levels
| Level | Recovery | Use Case |
|---|---|---|
ECCLevel.L |
~7% | Maximum data capacity |
ECCLevel.M |
~15% | General purpose (recommended) |
ECCLevel.Q |
~25% | Higher reliability |
ECCLevel.H |
~30% | Maximum recovery (logos, artistic QR) |
Documentation & Source
- Repository: https://github.com/afonsoft/QRCoder.Core
- Usage Guide: https://github.com/afonsoft/QRCoder.Core/blob/main/docs/en-US/usage-guide.md
- Issues: https://github.com/afonsoft/QRCoder.Core/issues
- License: MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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 is compatible. 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. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| .NET Framework | net48 is compatible. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.8
- Microsoft.Extensions.ObjectPool (>= 9.0.7)
- SkiaSharp (>= 3.119.0)
- SkiaSharp.NativeAssets.Win32 (>= 3.119.0)
- System.Buffers (>= 4.5.1)
- System.Memory (>= 4.5.5)
- System.Text.Encoding (>= 4.3.0)
- System.Text.Encoding.CodePages (>= 9.0.7)
- System.Text.Encoding.Extensions (>= 4.3.0)
-
.NETStandard 2.1
- Microsoft.Extensions.ObjectPool (>= 9.0.7)
- SkiaSharp (>= 3.119.0)
- SkiaSharp.NativeAssets.Win32 (>= 3.119.0)
- System.Text.Encoding.CodePages (>= 9.0.7)
-
net10.0
- Microsoft.Extensions.ObjectPool (>= 9.0.7)
- SkiaSharp (>= 3.119.0)
- SkiaSharp.NativeAssets.Win32 (>= 3.119.0)
-
net8.0
- Microsoft.Extensions.ObjectPool (>= 9.0.7)
- SkiaSharp (>= 3.119.0)
- SkiaSharp.NativeAssets.Win32 (>= 3.119.0)
- System.Text.Encoding.CodePages (>= 9.0.7)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on QRCoder.Core:
| Package | Downloads |
|---|---|
|
ArielCore.BaseHelpers
Package Description |
|
|
DevPro.Core
Package Description |
|
|
Lib.Servicos.Integracoes
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Release version 2.0.0