pdf417

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pdf417 encodes ISO/IEC 15438:2015 PDF417 logical symbols.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidInput and ErrUnsupported classify PDF417 option failures.
	ErrInvalidInput = errors.New("pdf417: invalid input")
	// ErrUnsupported reports a valid option not implemented by the encoder.
	ErrUnsupported = errors.New("pdf417: unsupported option")
)

Functions

This section is empty.

Types

type Compaction

type Compaction uint8

Compaction selects a PDF417 high-level encoding strategy.

const (
	// Automatic and the other constants select PDF417 compaction modes.
	Automatic Compaction = iota
	// Text forces text compaction.
	Text
	// Byte forces byte compaction.
	Byte
	// Numeric forces numeric compaction.
	Numeric
)

type ErrorCorrection

type ErrorCorrection uint8

ErrorCorrection selects one of the nine PDF417 correction levels.

const (
	// DefaultErrorCorrection and the other constants select correction levels.
	DefaultErrorCorrection ErrorCorrection = iota
	// Level0 adds two correction codewords.
	Level0
	// Level1 adds four correction codewords.
	Level1
	// Level2 adds eight correction codewords.
	Level2
	// Level3 adds sixteen correction codewords.
	Level3
	// Level4 adds thirty-two correction codewords.
	Level4
	// Level5 adds sixty-four correction codewords.
	Level5
	// Level6 adds 128 correction codewords.
	Level6
	// Level7 adds 256 correction codewords.
	Level7
	// Level8 adds 512 correction codewords.
	Level8
)

type Macro

type Macro struct {
	SegmentIndex int
	FileID       string
	LastSegment  bool
	FileName     string
	SegmentCount *int
	Timestamp    *int64
	Sender       string
	Addressee    string
	FileSize     *int64
	Checksum     *int
}

Macro describes a Macro PDF417 control block. FileID contains one or more three-digit codewords in the range 000 through 899.

type Options

type Options struct {
	Compaction      Compaction
	ErrorCorrection ErrorCorrection
	Compact         bool
	MinRows         int
	MaxRows         int
	MinColumns      int
	MaxColumns      int
	QuietZone       int
	ECI             int
	Macro           *Macro
}

Options controls PDF417 compaction, correction, layout, and quiet zone.

type Symbol

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

Symbol combines an immutable logical symbol with PDF417 metadata.

func Encode

func Encode(payload []byte, options Options) (Symbol, error)

Encode returns a PDF417 matrix with explicit compaction, correction, and row/column bounds. Each codeword row is rendered four modules high.

func (Symbol) Compact

func (symbol Symbol) Compact() bool

Compact reports whether compact PDF417 layout was selected.

func (Symbol) Compaction

func (symbol Symbol) Compaction() Compaction

Compaction returns the requested high-level encoding strategy.

func (Symbol) ECI

func (symbol Symbol) ECI() int

ECI returns the requested ECI assignment, or zero when absent.

func (Symbol) ErrorCorrection

func (symbol Symbol) ErrorCorrection() ErrorCorrection

ErrorCorrection returns the selected correction level.

func (Symbol) Logical

func (symbol Symbol) Logical() barcode.Symbol

Logical returns the immutable format-neutral symbol.

func (Symbol) Macro

func (symbol Symbol) Macro() (Macro, bool)

Macro returns a defensive copy of the Macro PDF417 control block.

Jump to

Keyboard shortcuts

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