diff options
author | Kurt Jung <kurt.w.jung@code.google.com> | 2014-04-12 08:20:52 -0400 |
---|---|---|
committer | Kurt Jung <kurt.w.jung@code.google.com> | 2014-04-12 08:20:52 -0400 |
commit | 8db660217be19062ca07e99cfa8a97affa86c49c (patch) | |
tree | 04247e6d59e378870a5857f6b6df52c58844ee7b | |
parent | 42ed8341d7cbd968acba5bab98b04302844c3e60 (diff) |
Documentation tweaks
-rw-r--r-- | doc.go | 5 | ||||
-rw-r--r-- | fpdf.go | 13 |
2 files changed, 10 insertions, 8 deletions
@@ -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/. @@ -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 { |