diff options
author | Kurt Jung <kurt.w.jung@code.google.com> | 2014-09-29 15:04:19 -0400 |
---|---|---|
committer | Kurt Jung <kurt.w.jung@code.google.com> | 2014-09-29 15:04:19 -0400 |
commit | 03177bf963088c765c949168f91e6878d1a7bbb5 (patch) | |
tree | a5e8007fa0da9889bad5511bdb25c7e56463ae2a | |
parent | 2003dae2718761b53dd3bcd302b794649e23a37d (diff) |
Clarified use case in which an io.Reader loads an image.
-rw-r--r-- | fpdf.go | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -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 } |