summaryrefslogtreecommitdiff
path: root/fpdf.go
diff options
context:
space:
mode:
authorKurt Jung <kurt.w.jung@code.google.com>2014-09-29 15:04:19 -0400
committerKurt Jung <kurt.w.jung@code.google.com>2014-09-29 15:04:19 -0400
commit03177bf963088c765c949168f91e6878d1a7bbb5 (patch)
treea5e8007fa0da9889bad5511bdb25c7e56463ae2a /fpdf.go
parent2003dae2718761b53dd3bcd302b794649e23a37d (diff)
Clarified use case in which an io.Reader loads an image.
Diffstat (limited to 'fpdf.go')
-rw-r--r--fpdf.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/fpdf.go b/fpdf.go
index 5beb694..bfa8fc5 100644
--- a/fpdf.go
+++ b/fpdf.go
@@ -2021,8 +2021,17 @@ func (f *Fpdf) Ln(h float64) {
// Supported JPEG formats are 24 bit, 32 bit and gray scale. Supported PNG
// formats are 24 bit, indexed color, and 8 bit indexed gray scale. If a GIF
// image is animated, only the first frame is rendered. Transparency is
-// supported. It is possible to put a link on the image. Remark: if an image is
-// used several times, only one copy is embedded in the file.
+// supported. It is possible to put a link on the image.
+//
+// imageNameStr may be the name of an image as registered with a call to either
+// RegisterImageReader() or RegisterImage(). In the first case, the image is
+// loaded using an io.Reader. This is generally useful when the image is
+// obtained from some other means than as a disk-based file. In the second
+// case, the image is loaded as a file. Alternatively, imageNameStr may
+// directly specify a sufficiently qualified filename.
+//
+// However the image is loaded, if it is used more than once only one copy is
+// embedded in the file.
//
// If x is negative, the current abscissa is used.
//
@@ -2036,11 +2045,11 @@ func (f *Fpdf) Ln(h float64) {
// If link refers to an internal page anchor (that is, it is non-zero; see
// AddLink()), the image will be a clickable internal link. Otherwise, if
// linkStr specifies a URL, the image will be a clickable external link.
-func (f *Fpdf) Image(fileStr string, x, y, w, h float64, flow bool, tp string, link int, linkStr string) {
+func (f *Fpdf) Image(imageNameStr string, x, y, w, h float64, flow bool, tp string, link int, linkStr string) {
if f.err != nil {
return
}
- info := f.RegisterImage(fileStr, tp)
+ info := f.RegisterImage(imageNameStr, tp)
if f.err != nil {
return
}