Installation
Complete guide to installing and setting up Lector in your React application
Prerequisites
Before installing Lector, make sure you have:
- Node.js 16.0 or later
- A React project (version 16.8 or later)
- npm, yarn, pnpm, or bun package manager
Installing the Package
- Install the main package and its peer dependency:
Setting up PDF.js Worker
- Configure the PDF.js worker in your application:
App Router (default)
In your PDF viewer component:
Pages Directory
In your PDF viewer component:
Required Styles
- Import the required CSS styles. You can do this in your main CSS file or component:
Verifying Installation
To verify that Lector is properly installed, create a basic PDF viewer component:
Troubleshooting
If you encounter any issues during installation:
- Make sure all peer dependencies are installed
- Check that the PDF.js worker is properly configured
- Verify that the required CSS files are imported
- Ensure your React version is compatible
Next Steps
Now that you have Lector installed, you can: