Skip to content

engine: hyperref pdftitle/pdfauthor set the PDF document metadata - #211

Merged
tannevaled merged 1 commit into
mainfrom
hyperref-pdfinfo
Sep 3, 2026
Merged

engine: hyperref pdftitle/pdfauthor set the PDF document metadata#211
tannevaled merged 1 commit into
mainfrom
hyperref-pdfinfo

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

The engine built every PDF with an empty information dictionary, so a produced document had no title or author in its properties — a viewer showed the filename and reference managers (Zotero, Mendeley) read nothing. \hypersetup{pdftitle=…,pdfauthor=…} — and the package-option form \usepackage[pdftitle=…]{hyperref} — now populate go-pdfkit's /Info /Title and /Author.

Because go-pdfkit v0.10.0 encodes a non-ASCII text string as UTF-16BE, an accented title — pdftitle={Résumé des travaux} — is correct in the PDF. This is the direct payoff of that encoding work.

Scope: pdftitle/pdfauthor map to go-pdfkit's existing Title/Author fields (engine-only). pdfsubject/pdfkeywords need new go-pdfkit /Info fields and are left for a follow-up.

Verification

A document with pdftitle/pdfauthor renders /Title and /Author in the (uncompressed) info dictionary, from both the \hypersetup and package-option forms; an accented title is UTF-16BE (<FEFF…>), not raw UTF-8; a document with no pdftitle emits no /Title as before. Full suite, conformance ratchet, go vet and gofmt green.

🤖 Generated with Claude Code

The engine built every PDF with an empty information dictionary, so a produced
document had no title or author in its properties — a viewer showed the filename
and reference managers read nothing. \hypersetup{pdftitle=…,pdfauthor=…} (and the
package-option form) now populate go-pdfkit's /Info /Title and /Author.

Because go-pdfkit v0.10.0 encodes a non-ASCII text string as UTF-16BE, an accented
title — pdftitle={Résumé des travaux} — is correct in the PDF, which is the direct
payoff of that encoding work.

Scope: pdftitle and pdfauthor map to go-pdfkit's existing Title/Author. pdfsubject
and pdfkeywords need new go-pdfkit Info fields and are left for a follow-up.

Verified: a document with pdftitle/pdfauthor renders /Title and /Author in the
(uncompressed) info dictionary from both the \hypersetup and package-option forms;
an accented title is UTF-16BE (<FEFF…>), not raw UTF-8; a document with no pdftitle
emits no /Title as before. Full suite, conformance ratchet, go vet and gofmt green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit dd60674 into main Sep 3, 2026
18 checks passed
@tannevaled
tannevaled deleted the hyperref-pdfinfo branch September 3, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant