File: fpdf.go

package info (click to toggle)
golang-github-ruudk-golang-pdf417 0.0~git20181029.1af4ab5-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 160 kB
  • sloc: makefile: 3
file content (28 lines) | stat: -rw-r--r-- 400 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package main

import (
	"github.com/jung-kurt/gofpdf"
	"github.com/jung-kurt/gofpdf/contrib/barcode"
	"fmt"
)

func main() {
	pdf := gofpdf.New("P", "mm", "A4", "")
	pdf.AddPage()

	barcode.Barcode(
		pdf,
		barcode.RegisterPdf417(pdf, "Hello world", 2, 2),
		20,
		0,
		150,
		30,
		false,
	)

	err := pdf.OutputFileAndClose("hello.pdf")

	if err != nil {
		fmt.Println("Something went wrong")
	}
}