lector

lector

Simple, fast primitives for building pdf viewers. maintained by @unriddle-ai

Stars: 209

Visit
 screenshot

Lector is a text analysis tool that helps users extract insights from unstructured text data. It provides functionalities such as sentiment analysis, keyword extraction, entity recognition, and text summarization. With Lector, users can easily analyze large volumes of text data to uncover patterns, trends, and valuable information. The tool is designed to be user-friendly and efficient, making it suitable for both beginners and experienced users in the field of natural language processing and text mining.

README:

Simple primitives to compose powerful PDF viewing experiences.
powered by PDF.js and React

lector

A composable, headless PDF viewer toolkit for React applications, powered by PDF.js. Build feature-rich PDF viewing experiences with full control over the UI and functionality.

npm version License: MIT

Installation

npm install @unriddle-ai/lector pdfjs-dist

# or with yarn
yarn add @unriddle-ai/lector pdfjs-dist

# or with pnpm
pnpm add @unriddle-ai/lector pdfjs-dist

Basic Usage

Here's a simple example of how to create a basic PDF viewer:

import { CanvasLayer, Page, Pages, Root, TextLayer } from "@unriddle-ai/lector";
import "pdfjs-dist/web/pdf_viewer.css";

export default function PDFViewer() {
  return (
    <Root
      fileURL='/sample.pdf'
      className='w-full h-[500px] border overflow-hidden rounded-lg'
      loader={<div className='p-4'>Loading...</div>}>
      <Pages className='p-4'>
        <Page>
          <CanvasLayer />
          <TextLayer />
        </Page>
      </Pages>
    </Root>
  );
}

Features

  • 📱 Responsive and mobile-friendly
  • 🎨 Fully customizable UI components
  • 🔍 Text selection and search functionality
  • 📑 Page thumbnails and outline navigation
  • 🌗 First-class dark mode support
  • 🖱️ Pan and zoom controls
  • 📝 Form filling support
  • 🔗 Internal and external link handling

Contributing

We welcome contributions! Key areas we're focusing on:

  1. Performance optimizations
  2. Accessibility improvements
  3. Mobile/touch interactions
  4. Documentation and examples

Thanks

Special thanks to these open-source projects that provided inspiration:

License

MIT © Unriddle AI

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for lector

Similar Open Source Tools

For similar tasks

For similar jobs