Skip to main content

Write the metadata

set-metadata writes the eight standard document information fields. A field you leave out keeps its value.
As a stage on a conversion:
Chromium takes the title from the page’s <title>, and LibreOffice from the document’s properties; set-metadata overrides them.

Read the metadata

PDF.metadata() answers the same eight fields, each when set, under each PDF’s name. A PDF without metadata answers {}.
A date comes back as the PDF stores it: a PDF date (D:20260101120000Z), which set-metadata takes, or an XMP date (2026-01-01T12:00:00Z) when only the XMP metadata holds it.

Bookmarks

set-bookmarks replaces the bookmarks, the outline viewers show beside the pages. Each bookmark takes a title, a pageNumber, and optional children.
PDF.bookmarks() reads them back in the same shape:
To build bookmarks while converting instead, set nativeBookmarks: true on a Chromium conversion (from the headings), or keep LibreOffice’s default nativeBookmarks. See Reference — PDF.