jung-kurt / gofpdf

A PDF document generator with high level support for text, drawing and images
http://godoc.org/github.com/jung-kurt/gofpdf
MIT License
4.31k stars 777 forks source link

Add support for imported objects and templates to version 1 of gofpdf. #257

Closed phpdave11 closed 5 years ago

jung-kurt commented 5 years ago

Thanks, @phpdave11! Could you make a few small changes?

First, README.md is a derived file; it is automatically generated from doc/document.md so doc.go and index.html can be kept in sync with the README file. You'll need a recent version of pandoc to generate the output. If you don't have this, no worries -- I can make the change.

Second, can you fix the problems reported by make check?

gofmt: 97%
    contrib/gofpdi/gofpdi.go
    Line 1: warning: file is not gofmted with -s (gofmt)
golint: 95%
    fpdf.go
    Line 3108: warning: comment on exported method Fpdf.ImportObjects should be of the form "ImportObjects ..." (golint)
    Line 3115: warning: comment on exported method Fpdf.ImportObjPos should be of the form "ImportObjPos ..." (golint)
    Line 3176: warning: comment on exported method Fpdf.UseImportedTemplate should be of the form "UseImportedTemplate ..." (golint)
    Line 3181: warning: comment on exported method Fpdf.ImportTemplates should be of the form "ImportTemplates ..." (golint)
    contrib/gofpdi/gofpdi.go
    Line 20: warning: comment on exported function ImportPage should be of the form "ImportPage ..." (golint)
    Line 54: warning: comment on exported function UseImportedTemplate should be of the form "UseImportedTemplate ..." (golint)

I've done this already for the v2 branch. I really dislike that golint thinks Id should be IDbut a clean report from golint tips the scale in favor of compliance. (See Capitalization of Initialisms.) I disregard the gocyclo complaints.

phpdave11 commented 5 years ago

@jung-kurt I've fixed the issues reported by make check. I also installed pandoc and and ran make clean && make but it looks like the generated README.md file and doc.go were already up to date.

jung-kurt commented 5 years ago

Nice work, @phpdave11! Thanks for this very useful contribution!

phpdave11 commented 5 years ago

@jung-kurt Thanks! I'm glad to help.