summaryrefslogtreecommitdiff
path: root/contrib/tiff
diff options
context:
space:
mode:
authorKurt <kurt.w.jung@gmail.com>2016-11-12 07:14:22 -0500
committerKurt <kurt.w.jung@gmail.com>2016-11-12 07:14:22 -0500
commit8905a622336664d66de462bbbaffea5acc26026f (patch)
treeff0bc5681c1290f594445a06deb92b1d5d6810d5 /contrib/tiff
parent83f63e773b4dd5516af63ba8d7278e21f96f2062 (diff)
Document the TIFF image functions. Correct related documentation.
Diffstat (limited to 'contrib/tiff')
-rw-r--r--contrib/tiff/tiff.go14
-rw-r--r--contrib/tiff/tiff_test.go1
2 files changed, 13 insertions, 2 deletions
diff --git a/contrib/tiff/tiff.go b/contrib/tiff/tiff.go
index 5bc34d9..3f13a38 100644
--- a/contrib/tiff/tiff.go
+++ b/contrib/tiff/tiff.go
@@ -30,7 +30,12 @@ import (
"golang.org/x/image/tiff"
)
-// RegisterReader ...
+// RegisterReader registers a TIFF image, adding it to the PDF file but not
+// adding it to the page. imgName specifies the name that will be used in the
+// call to Image() that actually places the image in the document. options
+// specifies various image properties; in this case, the ImageType property
+// should be set to "tiff". The TIFF image is a reader from the reader
+// specified by r.
func RegisterReader(fpdf *gofpdf.Fpdf, imgName string, options gofpdf.ImageOptions, r io.Reader) (info *gofpdf.ImageInfoType) {
var err error
var img image.Image
@@ -55,7 +60,12 @@ func RegisterReader(fpdf *gofpdf.Fpdf, imgName string, options gofpdf.ImageOptio
return
}
-// RegisterFile ...
+// RegisterFile registers a TIFF image, adding it to the PDF file but not
+// adding it to the page. imgName specifies the name that will be used in the
+// call to Image() that actually places the image in the document. options
+// specifies various image properties; in this case, the ImageType property
+// should be set to "tiff". The TIFF image is read from the file specified by
+// tiffFileStr.
func RegisterFile(fpdf *gofpdf.Fpdf, imgName string, options gofpdf.ImageOptions, tiffFileStr string) (info *gofpdf.ImageInfoType) {
var f *os.File
var err error
diff --git a/contrib/tiff/tiff_test.go b/contrib/tiff/tiff_test.go
index d222375..33b294b 100644
--- a/contrib/tiff/tiff_test.go
+++ b/contrib/tiff/tiff_test.go
@@ -6,6 +6,7 @@ import (
"github.com/jung-kurt/gofpdf/internal/example"
)
+// ExampleRegisterFile demonstrates the loading and display of a TIFF image.
func ExampleRegisterFile() {
pdf := gofpdf.New("L", "mm", "A4", "")
pdf.SetFont("Helvetica", "", 12)