Table of Contents

Class QrCode

Namespace
MiPdf.Barcodes
Assembly
MiPdf.dll

QR Code (ISO/IEC 18004) model 2, versions 1-40, all error correction levels. Numeric, alphanumeric and byte (UTF-8) mode are selected automatically.

public sealed class QrCode : MatrixBarcode
Inheritance
QrCode
Inherited Members

Examples

var qr = QrCode.Create("https://example.com");
canvas.DrawBarcode(qr, 450, 700, 80);   // 80 x 80 pt

Properties

ErrorCorrection

The error correction level used.

public QrErrorCorrection ErrorCorrection { get; }

Property Value

QrErrorCorrection

Mask

The mask pattern used (0-7).

public int Mask { get; }

Property Value

int

Version

The symbol version (1-40); the size is 17 + 4 * version modules.

public int Version { get; }

Property Value

int

Methods

Create(string, QrCodeOptions)

Creates a QR Code of the smallest version between MinVersion and MaxVersion that holds text. The quiet zone is 4 modules.

public static QrCode Create(string text, QrCodeOptions options)

Parameters

text string
options QrCodeOptions

Returns

QrCode

Exceptions

ArgumentException

text does not fit into the allowed versions.

Create(string, QrErrorCorrection)

Creates a QR Code of the smallest version that holds text at the given error correction level.

public static QrCode Create(string text, QrErrorCorrection errorCorrection = QrErrorCorrection.M)

Parameters

text string
errorCorrection QrErrorCorrection

Returns

QrCode

Exceptions

ArgumentException

text is too long for a QR Code.