This commit is contained in:
Daniel 2024-11-28 23:04:35 +08:00
parent 384bec36a3
commit 4feaa2aa5f
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
4 changed files with 12 additions and 6 deletions

View file

@ -812,7 +812,7 @@ func ExportHTML(id, savePath string, pdf, image, keepFold, merge bool) (name, do
link.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: []byte(" ")})
link.AppendChild(&ast.Node{Type: ast.NodeCloseBracket})
link.AppendChild(&ast.Node{Type: ast.NodeOpenParen})
link.AppendChild(&ast.Node{Type: ast.NodeLinkDest, Tokens: []byte("pdf-outline://" + h.ID)})
link.AppendChild(&ast.Node{Type: ast.NodeLinkDest, Tokens: []byte(PdfOutlineScheme + "://" + h.ID)})
link.AppendChild(&ast.Node{Type: ast.NodeCloseParen})
h.PrependChild(link)
}
@ -1201,6 +1201,10 @@ func processPDFLinkEmbedAssets(pdfCtx *model.Context, assetDests []string, remov
return
}
if 1 > len(assetLinks) {
return
}
if _, removeErr := pdfcpu.RemoveAnnotations(pdfCtx, nil, nil, nil, false); nil != removeErr {
logging.LogWarnf("remove annotations failed: %s", removeErr)
}