From 3da37926268f1057e411f5f5a1cff94fc55329ed Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 10 Nov 2016 12:33:16 -0500 Subject: Support standard tiff images --- contrib/tiff/tiff_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 contrib/tiff/tiff_test.go (limited to 'contrib/tiff/tiff_test.go') diff --git a/contrib/tiff/tiff_test.go b/contrib/tiff/tiff_test.go new file mode 100644 index 0000000..28163a0 --- /dev/null +++ b/contrib/tiff/tiff_test.go @@ -0,0 +1,22 @@ +package tiff_test + +import ( + "github.com/jung-kurt/gofpdf" + "github.com/jung-kurt/gofpdf/contrib/tiff" + "github.com/jung-kurt/gofpdf/internal/example" +) + +func ExampleTiff() { + pdf := gofpdf.New("L", "mm", "A4", "") + pdf.SetFont("Helvetica", "", 12) + pdf.SetFillColor(200, 200, 220) + pdf.AddPageFormat("L", gofpdf.SizeType{Wd: 200, Ht: 200}) + opt := gofpdf.ImageOptions{ImageType: "tiff", ReadDpi: false} + _ = tiff.RegisterFile(pdf, "sample", opt, "../../image/golang-gopher.tiff") + pdf.Image("sample", 0, 0, 200, 200, false, "", 0, "") + fileStr := example.Filename("Fpdf_Contrib_Tiff") + err := pdf.OutputFileAndClose(fileStr) + example.Summary(err, fileStr) + // Output: + // Successfully generated ../../pdf/Fpdf_Contrib_Tiff.pdf +} -- cgit v1.2.1-24-ge1ad