Documentation ¶
Index ¶
Examples ¶
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 ¶
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.
Example ¶
s := svg.New(os.Stdout) // Create the barcode qrCode, _ := qr.Encode("Hello World", qr.M, qr.Auto) // Write QR code to SVG qs := NewQrSVG(qrCode, 5) qs.StartQrSVG(s) qs.WriteQrSVG(s) s.End()
Output:
func (*QrSVG) SetStartPoint ¶
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 ¶
WriteQrSVG writes the QR Code to SVG.