Repository navigation
Properties
huzpsb edited this page Oct 25, 2026
·
1 revision
Manage custom document properties (key/value entries of the info dictionary).
pdfcpu2 properties list in.pdf
pdfcpu2 properties add in.pdf 'key = value' # one
pdfcpu2 properties add in.pdf 'key1 = val1' 'key2 = val2' # several
pdfcpu2 properties remove in.pdf # remove all
pdfcpu2 properties remove in.pdf Subject # by namePipeline:
cat brochure.pdf | pdfcpu2 properties add - - 'Subject = Product Launch' > described.pdfpackage main
import (
"context"
"github.com/huzpsb/pdfcpu2/pkg/api"
"github.com/huzpsb/pdfcpu2/pkg/pdfcpu/model"
)
func main() {
ctx := context.Background()
conf := model.NewDefaultConfiguration()
props := map[string]string{
"Subject": "Product Launch",
"Owner": "acme",
}
err := api.AddPropertiesFile(ctx, "in.pdf", "out.pdf", props, conf)
if err != nil {
panic(err)
}
err = api.RemovePropertiesFile(ctx, "in.pdf", "out2.pdf", []string{"Subject"}, conf)
_ = err
}Inspector: api.Properties(ctx, rs, conf) (map[string]string, error). Related: Keywords, Info.
pdfcpu2 wiki
Getting started
Fork features
Inspect
Document
Pages
Content
Extract
Resources
Security
Viewer
Trust
Developers