Skip to content

Text annotations, and styled and positioned bookmarks - #49

Merged
tannevaled merged 1 commit into
mainfrom
feat/text-annotations-outline-options
Oct 20, 2026
Merged

tannevaled merged 1 commit into
mainfrom
feat/text-annotations-outline-options

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Adds Page.AddTextAnnotation (sticky notes: contents, author, subject, icon, colour, opacity) and Document.AddOutlineItemWith (bold/italic titles, /XYZ position). Needed by go-slides' --pdf-notes and --pdf-outlines, which reproduce marp-cli 4.5.1's PDF output.

Additive, so MINOR: v0.16.0 once merged (the main session tags; I do not).

  • Tests read the annotations and bookmarks back through rsc.io/pdf, classic and object-stream layouts; the classic writer's golden hash test is unchanged.
  • Security: no new parsing; the contents go through the same text-string escaping as titles.
  • Performance: a page with no note pays one nil slice append.
  • README updated. The landing and docs sites list no per-API surface for annotations or bookmarks (checked), so nothing to change there.

🤖 Generated with Claude Code

Page.AddTextAnnotation writes a /Text annotation (PDF 32000-1 12.5.6.4):
contents, author (/T), subject (/Subj), icon (/Name), colour (/C) and
opacity (/CA). Document.AddOutlineItemWith adds a bookmark whose title is
bold or italic (/F) and whose destination is [page /XYZ x y null] instead of
/Fit. Both exist for go-slides' --pdf-notes and --pdf-outlines, which follow
marp-cli's output; AddOutlineItem is unchanged and the classic writer's
golden hash too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 87316d2 into main Oct 20, 2026
1 check passed
@tannevaled
tannevaled deleted the feat/text-annotations-outline-options branch October 20, 2026 07:19
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