Exemple #1
0
func ExampleRegisterEAN() {
	pdf := createPdf()

	key := barcode.RegisterEAN(pdf, "96385074")
	barcode.Barcode(pdf, key, 15, 15, 100, 10, false)

	fileStr := example.Filename("contrib_barcode_RegisterEAN")
	err := pdf.OutputFileAndClose(fileStr)
	example.Summary(err, fileStr)
	// Output:
	// Successfully generated ../../pdf/contrib_barcode_RegisterEAN.pdf
}
Exemple #2
0
func ExampleRegisterDataMatrix() {
	pdf := createPdf()

	key := barcode.RegisterDataMatrix(pdf, "datamatrix")
	barcode.Barcode(pdf, key, 15, 15, 20, 20, false)

	fileStr := example.Filename("contrib_barcode_RegisterDataMatrix")
	err := pdf.OutputFileAndClose(fileStr)
	example.Summary(err, fileStr)
	// Output:
	// Successfully generated ../../pdf/contrib_barcode_RegisterDataMatrix.pdf
}
Exemple #3
0
func ExampleRegisterTwoOfFive() {
	pdf := createPdf()

	key := barcode.RegisterTwoOfFive(pdf, "1234567895", true)
	barcode.Barcode(pdf, key, 15, 15, 100, 20, false)

	fileStr := example.Filename("contrib_barcode_RegisterTwoOfFive")
	err := pdf.OutputFileAndClose(fileStr)
	example.Summary(err, fileStr)
	// Output:
	// Successfully generated ../../pdf/contrib_barcode_RegisterTwoOfFive.pdf
}
Exemple #4
0
func ExampleRegisterQR() {
	pdf := createPdf()

	key := barcode.RegisterQR(pdf, "qrcode", qr.H, qr.Unicode)
	barcode.Barcode(pdf, key, 15, 15, 20, 20, false)

	fileStr := example.Filename("contrib_barcode_RegisterQR")
	err := pdf.OutputFileAndClose(fileStr)
	example.Summary(err, fileStr)
	// Output:
	// Successfully generated ../../pdf/contrib_barcode_RegisterQR.pdf
}
Exemple #5
0
func ExampleRegister() {
	pdf := createPdf()

	fileStr := example.Filename("contrib_barcode_Register")

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

	if err == nil {
		key := barcode.Register(bcode)
		barcode.Barcode(pdf, key, 15, 15, 100, 10, false)
	}

	err = pdf.OutputFileAndClose(fileStr)
	example.Summary(err, fileStr)
	// Output:
	// Successfully generated ../../pdf/contrib_barcode_Register.pdf
}