Thanks to visit codestin.com
Credit goes to github.com

Skip to content
forked from boombuler/barcode

Adding columns options in Encode func

License

Rapir-0/barcode

 
 

Repository files navigation

PDF417 Barcode Generator (Enhanced Fork)

Enhanced fork of boombuler/barcode with extended PDF417 barcode configuration options.

Key Enhancements

✨ New Feature: Column Configuration

This fork adds the ability to precisely control the number of columns in PDF417 barcodes through the Options structure.

type Options struct {
    ECCLevel byte // Error Correction Code Level (0-8)
    Columns  int  // Number of columns (0 = auto, 1-30 = fixed)
}

Configuration Parameters

ECCLevel (Error Correction Code Level)

  • Range: 0-8
  • Controls error correction level
  • Higher level = more redundancy, but larger barcode size

Columns (Number of columns)

  • 0 - automatic calculation of optimal column count
  • 1-30 - fixed number of columns
  • Allows creating barcodes of specific width

Usage

Basic Usage (Original Functionality)

import "github.com/Rapir-0/barcode/pdf417"

// Standard generation
barcode, err := pdf417.Encode("Hello World", 0)
if err != nil {
    log.Fatal(err)
}

Usage with New Options

import "github.com/Rapir-0/barcode/pdf417"

// Generation with custom options
options := pdf417.Options{
    ECCLevel: 4,      // Medium error correction level
    Columns:  10,     // Fixed 10 columns
}

barcode, err := pdf417.EncodeWithOptions("Hello World", options)
if err != nil {
    log.Fatal(err)
}

Different Configuration Examples

// Compact barcode (minimum columns)
compact := pdf417.Options{ECCLevel: 0, Columns: 1}

// Wide barcode with high reliability
wide := pdf417.Options{ECCLevel: 8, Columns: 30}

// Automatic selection with high error correction
auto := pdf417.Options{ECCLevel: 6, Columns: 0}

Compatibility

  • Fully compatible with the original boombuler/barcode library
  • All existing functions and interfaces preserved
  • New functionality available through additional methods

Original Features

This fork inherits all capabilities of the original library:

  • Support for multiple barcode types
  • High performance
  • Simple API
  • Scaling and color schemes

Installation

go get github.com/Rapir-0/barcode/pdf417

License

MIT License (inherited from the original library)


Fork Author: Rapir-0
Original Library: boombuler/barcode

About

Adding columns options in Encode func

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%