✨ Support adding the watermark on export PDF https://github.com/siyuan-note/siyuan/issues/9961
This commit is contained in:
parent
44a1d9a233
commit
efac191a82
1 changed files with 2 additions and 9 deletions
|
@ -863,7 +863,7 @@ func processPDFWatermark(pdfCtx *pdfcpu.Context, watermark bool) {
|
|||
m[kv[0]] = kv[1]
|
||||
}
|
||||
if "" == m["fontname"] {
|
||||
m["fontname"] = "LXGW WenKai Lite"
|
||||
m["fontname"] = "LXGWWenKaiLite-Regular"
|
||||
}
|
||||
descBuilder := bytes.Buffer{}
|
||||
for k, v := range m {
|
||||
|
@ -874,19 +874,12 @@ func processPDFWatermark(pdfCtx *pdfcpu.Context, watermark bool) {
|
|||
}
|
||||
desc = descBuilder.String()
|
||||
desc = desc[:len(desc)-1]
|
||||
|
||||
fontPath := filepath.Join(util.AppearancePath, "fonts", "LxgwWenKai-Lite-1.311", "LXGWWenKaiLite-Regular.ttf")
|
||||
err := api.InstallFonts([]string{fontPath})
|
||||
if nil != err {
|
||||
logging.LogErrorf("install font [%s] failed: %s", fontPath, err)
|
||||
}
|
||||
fonts, err := api.ListFonts()
|
||||
if nil != err {
|
||||
logging.LogErrorf("list fonts failed: %s", err)
|
||||
} else {
|
||||
for _, f := range fonts {
|
||||
logging.LogInfof("installed font: %s", f)
|
||||
}
|
||||
}
|
||||
|
||||
mode := "text"
|
||||
if gulu.File.IsExist(str) {
|
||||
|
|
Loading…
Add table
Reference in a new issue