Essentials

Document Sources

Supported input types for PDF loading and thumbnail rendering.

Supported source types

Papyrium accepts these source types:

  • File
  • Blob
  • ArrayBuffer
  • Uint8Array
  • string

In browser apps, prefer File, Blob, or byte arrays. This keeps behavior explicit and aligns with worker processing.

const bytes = new Uint8Array(await file.arrayBuffer());
await instance.load(bytes);

Thumbnail rendering

Use renderThumbnails for previews or sidebars.

const urls = await instance.renderThumbnails({
  maxWidth: 200,
  maxHeight: 260,
  pageNumbers: [1, 2, 3],
});