Skip to content
Inkoxide

Search covers every page and heading of the docs. Use ↑ ↓ and ↵.

Document

The PDF itself: its metadata, language, fallback fonts, PDF/A and encryption.

Edit this page

Import them from @inkoxide/render. Examples, and how these components work together, are in the guide.

Document

The PDF: title, author, subject, keywords, creator, producer, lang ("en-US"), creationDate, pageMode, pageLayout and fallbackFonts (metadata).

import { Document, Page, Text } from '@inkoxide/render';

export default function Example() {
  return (
    <Document title="Quarterly report" author="Ada Lovelace" lang="en-US">
      <Page size={[320, 140]} className="p-6">
        <Text className="text-lg font-bold">Quarterly report</Text>
        <Text className="mt-1 text-gray-500">Its title, author and language are in the file’s properties.</Text>
      </Page>
    </Document>
  );
}
The PDF this example renders.
PropTypeDefaultDescription
titlestring
authorstring
subjectstring
keywordsstring
creatorstring
producerstringInkoxide <version>The PDF producer.
langstringBCP-47 language of the document ("en-US"); also selects hyphenation patterns.
creationDatestringRFC 3339 timestamp written to the PDF. Omit it for deterministic output.
pageModeMeta['pageMode']What the viewer shows when it opens the PDF: no panel, the bookmarks, page thumbnails or the pages full screen. Default: 'useOutlines' when there are bookmarks, else 'useNone'.
pageLayoutMeta['pageLayout']How the viewer lays out the pages: one at a time, one scrolling column, two columns or two pages side by side (odd pages on the left or the right). Default: the viewer's setting.
fallbackFontsstring[]['NotoSans-Regular']Font ids tried for characters missing from a run's font, at most 256; an id listed again is skipped.
debugbooleanOutlines the boxes of every element on every page (debug on each <Page>).
conformanceConformanceWrite PDF/A, for archiving: 'PDF/A-2b' (or 'PDF/A-2'), 'PDF/A-3b' or 'PDF/A-1b'. PDF/A-1b has no transparency: a render fails with PDFA_CONFLICT at the first colour with alpha, opacity, image with an alpha channel or debug outline. The render option pdfA wins over this prop. Default: plain PDF.
userPasswordstringEncrypts the PDF (AES-256): the password that opens it. Printable ASCII, at most 127 bytes. Not part of the document tree, and never in the render result. The render option encryption replaces these three props.
ownerPasswordstringThe password that lifts permissions. Default: the user password.
permissionsPermissionsWhat a reader without the owner password may do; needs an ownerPassword other than userPassword.

Synced from components/document.md in the inkoxide repository.