-1
Good morning everyone, I am new to the Golang language and I am having difficulties in a text printing file in PDF generation that I was asked to study. The difficulty is in creating the variable "err" in which I can’t develop, I was able to notice that the error is due to the source that the file is trying to use and my machine does not have the file of this font. Since it’s a Github file, I didn’t make it, I got it ready to analyze the structure, I’ll make the link available. Thanks in advance, and if you’re confused the question I’m sorry, because it’s my first time here. https://github.com/signintech/gopdf
package main
import (
"log"
"github.com/signintech/gopdf"
)
func main() {
pdf := gopdf.GoPdf{}
pdf.Start(gopdf.Config{PageSize: *gopdf.PageSizeA4})
pdf.AddPage()
//err := pdf.AddTTFFont("wts11", "../ttf/wts11.ttf")
err := pdf.
if err != nil {
log.Print(err.Error())
return
}
err = pdf.SetFont("wts11", "", 14)
if err != nil {
log.Print(err.Error())
return
}
pdf.Cell(nil, "您好")
pdf.WritePdf("hello.pdf")
}