2024-07-24 08:38:42 +02:00
2024-05-10 15:05:18 +07:00
2024-02-01 00:07:40 +01:00
2024-05-10 15:03:15 +07:00
2024-05-13 14:26:29 +07:00
2024-05-10 15:03:15 +07:00
2024-05-10 15:03:15 +07:00
2023-09-22 15:45:43 +02:00
2024-05-15 21:06:42 +07:00
2024-05-15 16:23:45 +02:00
2024-05-10 15:03:15 +07:00
2024-05-10 15:03:15 +07:00

PDF viewer for RAG applications

PDF viewer component as used by secinsights. Using react-pdf.

Installation

npm install @llamaindex/pdf-viewer

Usage

import React from 'react';

import { PDFViewer, PdfFocusProvider } from '@llamaindex/pdf-viewer';

const file = {
  id: 'sample-document',
  url: 'https://d687lz8k56fia.cloudfront.net/sec-edgar-filings/0001045810/10-Q/0001045810-22-000147/filing-details.pdf',
};

function App() {
  return (
    <div className="AppContainer">
      <PdfFocusProvider>
        <PDFViewer file={file} />
      </PdfFocusProvider>
    </div>
  );
}

Custom Styles

<PdfFocusProvider>
  <PDFViewer containerClassName="your-container-class-name" file={file} />
</PdfFocusProvider>

Multiple PDF Files

<PdfFocusProvider>
  <div className="your-layout-class-name">
    <PDFViewer file={file1} />
    <PDFViewer file={file2} />
    <PDFViewer file={file3} />
  </div>
</PdfFocusProvider>

🙏 Thanks

Thanks to the developers of the following dependencies that we're using:

  • react-pdf
  • @wojtekmaj/react-hooks
  • react-window
  • react-intersection-observer
  • lodash
  • fuse.js
S
Description
Display PDFs in your RAG app
Readme MIT 26 MiB
Latest
2025-02-24 03:40:45 -05:00
Languages
TypeScript 94%
CSS 6%