go-barcode-reader

module
v0.0.0-...-4d579dd Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2015 License: MIT

README

Golang Barcode Reader for Windows

The sample demonstrates how to create a Golang Barcode Reader by wrapping Dynamsoft Barcode Reader SDK with SWIG on Windows.

golang barcode reader

Download & Installation

Basic Steps

  1. Set GOPATH as the location of your workspace. E.g. set GOPATH=f:\go-project

  2. Create your package path. E.g. mkdir %GOPATH%\src\github.com\dynamsoftsamples\go-barcode-reader\dbr

  3. Copy DynamsoftBarcodeReaderx64.dll to %GOPATH%\src\github.com\dynamsoftsamples\go-barcode-reader\dbr\bin

  4. Change directory to %GOPATH% and compile the package with go install github.com\dynamsoftsamples\go-barcode-reader\dbr. Alternatively, you can change directory to %GOPATH%\src\github.com\dynamsoftsamples\go-barcode-reader\dbr and compile the package with go install.

  5. A package dbr.a will be generated at %GOPATH%\pkg\windows_amd64\github.com\dynamsoftsamples\go-barcode-reader.

  6. Create %GOPATH%\github.com\dynamsoftsamples\go-barcode-reader\BarcodeReader\BarcodeReader.go .

    package main
    
    import (
      "github.com/dynamsoftsamples/go-barcode-reader/dbr"
      "os"
    )
    
    func main() {
      if len(os.Args) == 1 { // read the default image
        dbr.Decode_file("AllSupportedBarcodeTypes.tif")
      } else {
        dbr.Decode_file(os.Args[1])
      }
    }
    
    
  7. Copy DynamsoftBarcodeReaderx64.dll to %GOPATH%\bin.

  8. Change directory to %GOPATH% and run go install github.com\dynamsoftsamples\go-barcode-reader\BarcodeReader.

  9. Read a barcode image with %GOPATH%bin\BarcodeReader.exe <barcode image>

Blog

How to Use SWIG to Link Windows DLL with Golang

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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