csv_barcode

package module
v0.0.0-...-1083253 Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: MIT Imports: 12 Imported by: 0

README

barcode_pdf_generator

A small library that generates a PDF of barcodes.

Use

Setup of CSV File

The generator requires a csv file that must be formatted according to RFC 4180. To make sure everything works properly be sure:

  • Values are separated by commas.
  • All records end with a CRLF line break.
  • There are no headings on the fields (I hope the change this in the future).

For best results, I recommend using Google Sheets to make csv files. Excel CSVs generate a strange symbol between names. Hopefully I can fix this soon.

Values should be:

  1. Last Name
  2. First Name
  3. Pin or the numeric value of the barcode. If any alphanumeric values are enterred, only numerals will be used.
Generate Barcodes from a CSV File
  1. Use the ReadCsv(filepath) method with the absolute path to the csv file to return an array of Students that will be needed for step 2.
  2. Run GeneratePdf(pdfPath, filename, heading, []Student) using the full destination path, filename, and the []Students from step 1.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratePdf

func GeneratePdf(pdfPath, filename, heading string, students []Student)

Generates a pdf with barcodes and names below them.

func MakeBarcodes

func MakeBarcodes(fileDir string, records []Student)

Generates Barcodes to the requested directory

Types

type Student

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

func ReadCsv

func ReadCsv(filePath string) []Student

Reads CSV file. The file must comply with RFC 4180 "Common Format and MIME Type for CSV Files". This function will return []Student that's needed to run GeneratePdf

Jump to

Keyboard shortcuts

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