Hi,
I want to parse the HTML and pass the dynamic data to the HTML and then convert to PDF.
tmpl, err := template.ParseFiles("./templates/pdf-template.html")
err = tmpl.Execute(&buf, data)
pdf := gopdf.GoPdf{}
pdf.Start(gopdf.Config{PageSize: *gopdf.PageSizeA4})
pdf.AddTTFFont("roboto", "../assets/fonts/Roboto-Medium.ttf")
pdf.SetFont("roboto", "", 14)
pdf.AddPage()
is there any function available to add the text to PDF directly.
eg: pdf.HTMLToString(buf.String());
Hi, I want to parse the HTML and pass the dynamic data to the HTML and then convert to PDF. tmpl, err := template.ParseFiles("./templates/pdf-template.html") err = tmpl.Execute(&buf, data) pdf := gopdf.GoPdf{} pdf.Start(gopdf.Config{PageSize: *gopdf.PageSizeA4}) pdf.AddTTFFont("roboto", "../assets/fonts/Roboto-Medium.ttf") pdf.SetFont("roboto", "", 14) pdf.AddPage()
is there any function available to add the text to PDF directly. eg: pdf.HTMLToString(buf.String());