qrcode

package
v0.0.0-...-568f4c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package goqrsvg is an API that makes QR Code to SVG conversions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QrSVG

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

QrSVG holds the data related to the size, location, and block size of the QR Code. Holds unexported fields.

func NewQrSVG

func NewQrSVG(qr barcode.Barcode, blockSize int) QrSVG

NewQrSVG contructs a QrSVG struct. It takes a QR Code in the form of barcode.Barcode and sets the "pixel" or block size of QR Code in the SVG file.

func (*QrSVG) GetImageWidth

func (qs *QrSVG) GetImageWidth() int

func (*QrSVG) SetMarginBlock

func (qs *QrSVG) SetMarginBlock(n int)

func (*QrSVG) SetStartPoint

func (qs *QrSVG) SetStartPoint(x, y int)

SetStartPoint sets the top left start point of QR Code. This takes an X and Y value and then adds four white "blocks" to create the "quiet zone" around the QR Code.

func (*QrSVG) StartQrSVG

func (qs *QrSVG) StartQrSVG(s *svg.SVG)

StartQrSVG creates a start for writing an SVG file that only contains a barcode. This is similar to the svg.Start() method. This fucntion should only be used if you only want to write a QR code to the SVG. Otherwise use the regular svg.Start() method to start your SVG file.

func (*QrSVG) WriteQrSVG

func (qs *QrSVG) WriteQrSVG(s *svg.SVG) error

WriteQrSVG writes the QR Code to SVG.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL