package qrcode

import "github.com/edragoev1/pdfjet/v9/src/qrcode"

Package qrcode creates QR code barcodes.

Index

Types

type QRCode

type QRCode struct {
	// contains filtered or unexported fields
}

QRCode used to create 2D QR Code barcodes. Please see Example_34.

func NewQRCode
func NewQRCode(str string, errorCorrectionLevel errorcorrectionlevel.ErrorCorrectionLevel) *QRCode

NewQRCode is 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. It panics if the string does not fit in a version 40 symbol. @param str the string to encode. @param errorCorrectionLevel the desired error correction level.

func (*QRCode) DrawOn
func (qrcode *QRCode) DrawOn(page *pdfjet.Page) [2]float32

DrawOn 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. @param page the specified page. @return x and y coordinates of the bottom right corner of this component.

func (*QRCode) GetModules
func (qrcode *QRCode) GetModules() [][]*bool

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

func (*QRCode) SetAltDescription
func (qrcode *QRCode) SetAltDescription(altDescription string) *QRCode

SetAltDescription 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.

func (*QRCode) SetLocation
func (qrcode *QRCode) SetLocation(x, y float32) pdfjet.Drawable

SetLocation sets the location where this barcode will be drawn on the page. @param x the x coordinate of the top left corner of the barcode. @param y the y coordinate of the top left corner of the barcode.

func (*QRCode) SetModuleColor
func (qrcode *QRCode) SetModuleColor(color int32) *QRCode

SetModuleColor sets the color of the barcode.

func (*QRCode) SetModuleLength
func (qrcode *QRCode) SetModuleLength(moduleLength float32) *QRCode

SetModuleLength sets the module length of this barcode. The default value is 2.0f @param moduleLength the specified module length.