Repository navigation
Keywords
huzpsb edited this page Nov 8, 2026
·
2 revisions
Manage the document's keyword list (part of the info dictionary / metadata).
hspdf keywords list in.pdf
hspdf keywords add in.pdf music "virtual instruments" # one or more
hspdf keywords add in.pdf out.pdf music # with outFile
hspdf keywords remove in.pdf # remove all
hspdf keywords remove in.pdf out.pdf campaign-2026 # specificPipeline:
cat brochure.pdf | hspdf keywords add - - approved campaign-2026 > brochure-tagged.pdfpackage main
import (
"context"
"github.com/huzpsb/hspdf/pkg/api"
"github.com/huzpsb/hspdf/pkg/pdfcpu/model"
)
func main() {
ctx := context.Background()
conf := model.NewDefaultConfiguration()
err := api.AddKeywordsFile(ctx, "in.pdf", "out.pdf",
[]string{"approved", "campaign-2026"}, conf)
if err != nil {
panic(err)
}
err = api.RemoveKeywordsFile(ctx, "in.pdf", "out2.pdf", nil, conf) // nil = all
_ = err
}Inspectors: api.Keywords(ctx, rs, conf) ([]string, error); see also Properties and Info.
hspdf wiki
Getting started
Fork features
Inspect
Document
Pages
Content
Extract
Resources
Security
Viewer
Trust
Developers