Initial commit

This commit is contained in:
2021-04-06 20:12:09 +02:00
commit 6bcb596e81
13 changed files with 613 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package main
import (
"fmt"
"github.com/jung-kurt/gofpdf"
)
func main() {
pdf := gofpdf.New("P", "mm", "A4", "")
pdf.SetFontLocation("fonts")
errs := gofpdf.MakeFont("/usr/share/fonts/dejavu/DejaVuSans.ttf", "/home/joerg/go/src/github.com/jung-kurt/gofpdf/font/cp1252.map", "fonts", nil, true)
if errs != nil {
fmt.Println(errs)
}
errs2 := gofpdf.MakeFont("/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf", "/home/joerg/go/src/github.com/jung-kurt/gofpdf/font/cp1252.map", "fonts", nil, true)
if errs2 != nil {
fmt.Println(errs)
}
pdf.AddFont("DejaVuSans", "", "DejaVuSans.json")
pdf.AddFont("DejaVuSans-Bold", "", "DejaVuSans-Bold.json")
}