This commit is contained in:
laodaming
2023-06-15 19:14:19 +08:00
parent 51a33052d9
commit 4a5d84fb22
12 changed files with 458 additions and 14 deletions

View File

@@ -6,7 +6,7 @@ import (
"strings"
)
// html转 Pdf dataType = 1 为网页url dataType = 2为网页内容 outFile为空则不保存
// html转 Pdf dataType = 1 为网页url dataType = 2为网页内容 outFile为空则不保存(使用该方法需要安装工具 sudo apt-get install wkhtmltopdf)
func HtmlToPdfBase64(content string, dataType int, outFile ...string) (string, error) {
pdfg, err := wkhtmltopdf.NewPDFGenerator()
if err != nil {