Table of Contents

Class QRCode

Namespace
PDFjet.NET
Assembly
PDFjet.dll

Used to create 2D QR Code barcodes. Please see Example_34.

public class QRCode : IDrawable
Inheritance
QRCode
Implements
Inherited Members

Constructors

QRCode(string, ErrorCorrectionLevel)

Used to create 2D QR Code barcodes. The string is encoded in UTF-8, and the symbol is the smallest that holds it, from version 4, 33 by 33 modules, to version 40, 177 by 177 modules. At version 40 it holds up to 2,953 bytes at level L, 2,331 at M, 1,663 at Q and 1,273 at H, a byte fewer when the string is not all ASCII: it then starts with the ECI that tells the reader the bytes are UTF-8.

public QRCode(string str, ErrorCorrectionLevel errorCorrectionLevel)

Parameters

str string

the string to encode.

errorCorrectionLevel ErrorCorrectionLevel

the desired error correction level.

Exceptions

ArgumentException

If the string does not fit in a version 40 symbol.

Methods

DrawOn(Page)

Draws this barcode on the specified page. The dark modules next to each other in a row are filled as one rectangle, and the pen and the brush of the page are as they were after it.

public float[] DrawOn(Page page)

Parameters

page Page

the page to draw on.

Returns

float[]

x and y coordinates of the bottom right corner of this component.

GetModules()

Returns the modules of the QR code: true for dark and false for light modules.

public bool?[][] GetModules()

Returns

bool?[][]

the modules.

SetAltDescription(string)

Sets what the QR code says, such as the web address it carries, for a screen reader: a tagged document, PDF/UA or a PDF/A of level A, then has the QR code as a figure of that description. Without one, it is decoration, which a screen reader skips.

public QRCode SetAltDescription(string altDescription)

Parameters

altDescription string

the description.

Returns

QRCode

this QRCode object.

SetLocation(float, float)

Sets the location where this barcode will be drawn on the page.

public QRCode SetLocation(float x, float y)

Parameters

x float

the x coordinate of the top left corner of the barcode.

y float

the y coordinate of the top left corner of the barcode.

Returns

QRCode

this QRCode object.

SetModuleColor(int)

Sets the color of the QR code as a 0xRRGGBB value.

public QRCode SetModuleColor(int color)

Parameters

color int

Returns

QRCode

SetModuleLength(float)

Sets the module length of this barcode. The default value is 2.0f

public QRCode SetModuleLength(float moduleLength)

Parameters

moduleLength float

the specified module length.

Returns

QRCode

this QRCode object.