summaryrefslogtreecommitdiff
path: root/fpdf.go
diff options
context:
space:
mode:
authorKurt Jung <kurt.w.jung@code.google.com>2014-04-12 08:20:52 -0400
committerKurt Jung <kurt.w.jung@code.google.com>2014-04-12 08:20:52 -0400
commit8db660217be19062ca07e99cfa8a97affa86c49c (patch)
tree04247e6d59e378870a5857f6b6df52c58844ee7b /fpdf.go
parent42ed8341d7cbd968acba5bab98b04302844c3e60 (diff)
Documentation tweaks
Diffstat (limited to 'fpdf.go')
-rw-r--r--fpdf.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/fpdf.go b/fpdf.go
index 33dda59..fa17721 100644
--- a/fpdf.go
+++ b/fpdf.go
@@ -2036,13 +2036,14 @@ func (f *Fpdf) Image(fileStr string, x, y, w, h float64, flow bool, tp string, l
return
}
-// RegisterImageReader registers an image, reading it from Reader,
-// adding it to the PDF file but not adding it to the page.
-// Use Image() with the same name to add the image to the
-// page.
-// Note, that tp should be specified in this case.
+// RegisterImageReader registers an image, reading it from Reader r, adding it
+// to the PDF file but not adding it to the page. Use Image() with the same
+// name to add the image to the page. Note that tp should be specified in this
+// case.
+//
// See Image() for restrictions on the image and the "tp" parameters.
func (f *Fpdf) RegisterImageReader(imgName, tp string, r io.Reader) (info *ImageInfoType) {
+ // Thanks, Ivan Daniluk, for generalizing this code to use the Reader interface.
info, ok := f.images[imgName]
if ok {
return info
@@ -2340,7 +2341,7 @@ func (f *Fpdf) parsejpg(r io.Reader) (info *ImageInfoType) {
info = f.newImageInfo()
var (
data bytes.Buffer
- err error
+ err error
)
_, err = data.ReadFrom(r)
if err != nil {