gofpdfcontrib

module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2019 License: MIT

README

gofpdfcontrib

Packages that extend gofpdf and have non-standard dependencies.

Install ($GOPATH): go get -u github.com/jung-kurt/gofpdfcontrib/...

Install (module): git clone https://github.com/jung-kurt/gofpdfcontrib.git

Test: go test -v ./...

Quick start

package main

import (
	"fmt"
	"os"

	"github.com/boombuler/barcode/code128"
	"github.com/jung-kurt/gofpdf/v2"
	"github.com/jung-kurt/gofpdfcontrib/barcode"
)

func main() {

	pdf := gofpdf.New("L", "mm", "A4", "")
	pdf.SetFont("Helvetica", "", 12)
	pdf.SetFillColor(200, 200, 220)
	pdf.AddPage()

	bcode, err := code128.Encode("gofpdf")

	if err == nil {
		key := barcode.Register(bcode)
		var width float64 = 100
		var height float64 = 10.0
		barcode.BarcodeUnscalable(pdf, key, 15, 15, &width, &height, false)
		err = pdf.OutputFileAndClose("barcode.pdf")
	}

	if err != nil {
		fmt.Fprintln(os.Stderr, err)
	}

}

Directories

Path Synopsis
Package barcode provides helper methods for adding barcodes of different types to your pdf document.
Package barcode provides helper methods for adding barcodes of different types to your pdf document.
Package gofpdi wraps the gofpdi PDF library to import existing PDFs as templates.
Package gofpdi wraps the gofpdi PDF library to import existing PDFs as templates.
internal
example
Package example provides some helper routines for the test packages of gofpdf and its various contributed packages located beneath the contrib directory.
Package example provides some helper routines for the test packages of gofpdf and its various contributed packages located beneath the contrib directory.
Package tiff allows standard (LZW-compressed) TIFF images to be used in documents generated with gofpdf.
Package tiff allows standard (LZW-compressed) TIFF images to be used in documents generated with gofpdf.

Jump to

Keyboard shortcuts

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