Configuration

Chrome Options

Use full or minimal chrome, theme overrides, locale-aware text, and locale-inferred direction.

chrome configuration

PapyriumLoadConfiguration supports:

  • chrome: true
  • chrome: 'full' | 'minimal'
  • chrome: { mode, theme }

Full vs minimal

  • full: full chrome controls and sidebar behavior.
  • minimal: reduced chrome presentation.
await load({
  container: '#viewer',
  document: pdfBytes,
  chrome: {
    mode: 'full',
    theme: 'dark',
  },
});

papyrium chrome does not persist annotations to browser storage.
If you need persistence, handle it in your app wrapper (for example, listen to annotations.change and store only app-managed annotations).

Locale and i18n

When using chrome, locale is resolved through resolveChromeI18n when supported.

Supported chrome locales:

  • en-gb
  • pt-pt
  • fr-fr
  • es-es
  • de-de
  • el-gr
  • ja-jp
  • fa-ir
  • ar-sa
  • zh-cn
  • hi-in
  • bn-bd
  • ru-ru
  • ur-pk
  • id-id
  • pa-in
  • sw-ke
  • tr-tr
  • vi-vn

Direction behavior:

  • fa-ir, ar-sa, and ur-pk resolve to rtl.
  • ja-jp, the existing European locales, and all other supported locales resolve to ltr.
  • Unsupported locale values fall back to ltr.
  • Direction is inferred from locale only. There is no separate direction configuration field.
  • Direction updates apply at load time and when setLocale(...) is called at runtime.

Example: locale-driven direction

const instance = await load({
  container: '#viewer',
  document: pdfBytes,
  chrome: 'full',
  locale: 'ja-jp',
});

await instance.setLocale('fa-ir');