code

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package code implements creation of Barcode, MatrixCode and QrCode.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAutoBarRow

func NewAutoBarRow(code string, ps ...props.Barcode) core.Row

NewAutoBarRow is responsible to create an instance of a Barcode wrapped in a Row with automatic height. using this method the col size will be automatically set to the maximum value

  • code: The value that must be placed in the barcode
  • ps: A set of settings that must be applied to the barcode

func NewAutoMatrixRow

func NewAutoMatrixRow(code string, ps ...props.Rect) core.Row

NewAutoMatrixRow is responsible to create an instance of a Matrix code wrapped in a Row with automatic height.

  • code: The value that must be placed in the matrixcode
  • ps: A set of settings that must be applied to the matrixcode

func NewAutoQrRow

func NewAutoQrRow(code string, ps ...props.Rect) core.Row

NewAutoQrRow is responsible to create an instance of a qrcode wrapped in a Row with automatic height.

  • code: The value that must be placed in the qrcode
  • ps: A set of settings that must be applied to the qrcode

func NewBar

func NewBar(code string, ps ...props.Barcode) core.Component

NewBar is responsible to create an instance of a Barcode.

  • code: The value that must be placed in the barcode
  • ps: A set of settings that must be applied to the barcode

func NewBarCol

func NewBarCol(size int, code string, ps ...props.Barcode) core.Col

NewBarCol is responsible to create an instance of a Barcode wrapped in a Col.

  • size: O tamanho da coluna
  • code: The value that must be placed in the barcode
  • ps: A set of settings that must be applied to the barcode

func NewBarRow

func NewBarRow(height float64, code string, ps ...props.Barcode) core.Row

NewBarRow is responsible to create an instance of a Barcode wrapped in a Row. using this method the col size will be automatically set to the maximum value

  • height: The height of the line
  • code: The value that must be placed in the barcode
  • ps: A set of settings that must be applied to the barcode

func NewMatrix

func NewMatrix(code string, barcodeProps ...props.Rect) core.Component

NewMatrix is responsible to create an instance of a MatrixCode.

func NewMatrixCol

func NewMatrixCol(size int, code string, ps ...props.Rect) core.Col

NewMatrixCol is responsible to create an instance of a MatrixCode wrapped in a Col.

func NewMatrixRow

func NewMatrixRow(height float64, code string, ps ...props.Rect) core.Row

NewMatrixRow is responsible to create an instance of a MatrixCode wrapped in a Row.

func NewQr

func NewQr(code string, barcodeProps ...props.Rect) core.Component

NewQr is responsible to create an instance of a QrCode.

func NewQrCol

func NewQrCol(size int, code string, ps ...props.Rect) core.Col

NewQrCol is responsible to create an instance of a QrCode wrapped in a Col.

func NewQrRow

func NewQrRow(height float64, code string, ps ...props.Rect) core.Row

NewQrRow is responsible to create an instance of a QrCode wrapped in a Row.

Types

type Barcode

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

func (*Barcode) GetHeight

func (b *Barcode) GetHeight(_ core.Provider, cell *entity.Cell) float64

GetHeight returns the height that the barcode will have in the PDF

func (*Barcode) GetStructure

func (b *Barcode) GetStructure() *node.Node[core.Structure]

GetStructure returns the structure of a barcode. This method is typically used when creating tests

func (*Barcode) Render

func (b *Barcode) Render(provider core.Provider, cell *entity.Cell)

Render renders a Barcode into a PDF context. The paper cal this method in process to generate the pdf.

  • provider: Is the creator provider used to generate the pdf
  • cell: cell represents the space available to draw the component

func (*Barcode) SetConfig

func (b *Barcode) SetConfig(config *entity.Config)

SetConfig sets the configuration of a Barcode.

type MatrixCode

type MatrixCode = rectCode

type QrCode

type QrCode = rectCode

Jump to

Keyboard shortcuts

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