23 lines
670 B
Go
23 lines
670 B
Go
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")
|
|
}
|