Skip to content

PapyrusOpen source PDF/EPUB/TXT SDK

Build document readers with search, annotations, and theming for web and mobile (React + React Native).

What is inside

  • @papyrus-sdk/types: contracts for engines, annotations, and events.
  • @papyrus-sdk/core: Zustand store plus papyrusEvents for UI and app logic.
  • @papyrus-sdk/engine-pdfjs: web adapter built on PDF.js.
  • @papyrus-sdk/ui-react: web UI components (Topbar, Sidebar, Viewer).
  • @papyrus-sdk/engine-native: native engine bridge for iOS and Android.
  • @papyrus-sdk/ui-react-native: mobile UI components and sheets.

Why Papyrus

Papyrus is an open source PDF, EPUB, and TXT SDK for product teams that need a document experience closer to Figma or Notion: search, selection, highlights, and custom UI on top of a stable engine layer.

Quick snippet

Install and render a PDF viewer with the SDK:

bash
pnpm add @papyrus-sdk/core @papyrus-sdk/ui-react @papyrus-sdk/engine-pdfjs
tsx
import React, { useEffect, useState } from 'react';
import { PDFJSEngine } from '@papyrus-sdk/engine-pdfjs';
import { useViewerStore } from '@papyrus-sdk/core';
import { Viewer } from '@papyrus-sdk/ui-react';

export const App = () => {
  const [engine] = useState(() => new PDFJSEngine());
  const { initializeStore } = useViewerStore();

  useEffect(() => {
    initializeStore({ initialUITheme: 'dark' });
    engine.load('/sample.pdf');
    return () => engine.destroy();
  }, [engine, initializeStore]);

  return <Viewer engine={engine} />;
};

Use cases

  • Reading and annotating product specs, research, and design docs.
  • Knowledge bases with full-text search across PDF, EPUB, and TXT.
  • Legal and compliance review with highlights and notes.
  • Education and e-learning with reliable page and outline navigation.
  • Publishing workflows that need a branded, embeddable reader.

FAQ

Is Papyrus an open source PDF/EPUB/TXT SDK?

Yes. Papyrus is an open source SDK that provides a unified UI layer and multiple engines for PDF, EPUB, and TXT.

Can I swap the PDF engine?

Yes. The architecture is engine-agnostic so you can swap PDF.js, PDFium, or native engines without changing UI logic.

Does it work with React and React Native?

Yes. Papyrus ships UI layers for React on web and React Native on mobile.

Does it support annotations and search?

Yes. The core includes events, annotation state, and search hooks for building reader workflows.

Built for teams shipping reader UX

Papyrus focuses on real-world document UX: selection, highlights, search, and annotations, while keeping the engine details behind a consistent API. If you need an open source PDF SDK for a web or mobile app, this is the core building block.

Next steps