Skip to content

Commit

Permalink
docs: add Qr Code support
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Russkykh committed Sep 30, 2022
1 parent a3516c5 commit 7f1c030
Show file tree
Hide file tree
Showing 4 changed files with 897 additions and 9 deletions.
3 changes: 2 additions & 1 deletion cmd/document/pdf.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ func (pdf *PDF) RenderByTemplate(writer io.Writer, templateName string, data tem

// RenderByVirtualTemplate creates PDF from specified template content and data to writer
func (pdf *PDF) RenderByVirtualTemplate(writer io.Writer, templateContent string, data template.Context) error {
tmpl, err := template.NewVirtualTemplate(templateContent)
parsedTemplateContent := util.ProcessQrCodeTags(templateContent, data)
tmpl, err := template.NewVirtualTemplate(parsedTemplateContent)

if err != nil {
return err
Expand Down
13 changes: 12 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,20 @@ go 1.16
require (
github.com/SebastiaanKlippert/go-wkhtmltopdf v1.4.0
github.com/flosch/pongo2 v0.0.0-20200913210552-0d938eb266f3
github.com/go-swagger/go-swagger v0.30.3 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gopherjs/gopherjs v0.0.0-20210822113901-9ebd50d28389 // indirect
github.com/gorilla/handlers v1.4.0
github.com/gorilla/handlers v1.5.1
github.com/gorilla/mux v1.7.0
github.com/imdario/mergo v0.3.13 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e // indirect
github.com/smartystreets/assertions v0.0.0-20190215210624-980c5ac6f3ac // indirect
github.com/smartystreets/goconvey v1.6.4
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/viper v1.13.0 // indirect
go.mongodb.org/mongo-driver v1.10.2 // indirect
golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be // indirect
golang.org/x/net v0.0.0-20220927171203-f486391704dc // indirect
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec // indirect
)
Loading

0 comments on commit 7f1c030

Please sign in to comment.