summaryrefslogtreecommitdiff
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
parent42ed8341d7cbd968acba5bab98b04302844c3e60 (diff)
Documentation tweaks
-rw-r--r--doc.go5
-rw-r--r--fpdf.go13
2 files changed, 10 insertions, 8 deletions
diff --git a/doc.go b/doc.go
index 2c1ce71..a3ef6ff 100644
--- a/doc.go
+++ b/doc.go
@@ -60,8 +60,9 @@ adapted from Olivier Plathey by Manuel Cornes. Support for transformations is
adapted from the FPDF transformation script by Moritz Wagner and Andreas
Würmser. Lawrence Kesteloot provided code to allow an image's extent to be
determined prior to placement. Support for vertical alignment within a cell was
-provided by Stefan Schroeder. Bruno Michel has provided valuable assistance
-with the code.
+provided by Stefan Schroeder. Ivan Daniluk generalized the font and image
+loading code to use the Reader interface while maintaining backward
+compatibility. Bruno Michel has provided valuable assistance with the code.
The FPDF website is http://www.fpdf.org/.
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 {