engine: hyperref pdftitle/pdfauthor set the PDF document metadata - #211
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/Titleand/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/pdfauthormap to go-pdfkit's existingTitle/Authorfields (engine-only).pdfsubject/pdfkeywordsneed new go-pdfkit/Infofields and are left for a follow-up.Verification
A document with
pdftitle/pdfauthorrenders/Titleand/Authorin the (uncompressed) info dictionary, from both the\hypersetupand package-option forms; an accented title is UTF-16BE (<FEFF…>), not raw UTF-8; a document with nopdftitleemits no/Titleas before. Full suite, conformance ratchet,go vetandgofmtgreen.🤖 Generated with Claude Code