PDF.js is a JavaScript library for parsing and rendering PDF files, built by Mozilla. It's the engine behind Firefox's PDF viewer and can be integrated into React applications for custom PDF viewing experiences.
- Parse PDF files
- Render PDF pages
- Text extraction
- Metadata extraction
- Page rendering to canvas
- SVG rendering
- Web Worker support
- Stream processing
- Incremental loading
- Password-protected PDFs
- Canvas-based rendering
- SVG-based rendering
- Text layer rendering
- Annotation layer rendering
- XFA form rendering
- High-quality scaling
- Custom DPI
- Rotation support
- getDocument() - load PDF
- getPage() - get specific page
- render() - render to canvas
- getTextContent() - extract text
- getMetadata() - PDF metadata
- getOutline() - document outline
- getAnnotations() - page annotations
- getOperatorList() - drawing operations
- Web Worker for parsing (non-blocking)
- Streaming support
- Lazy loading
- Caching
- Memory management
- Progressive rendering
- Search functionality
- Find controller
- Thumbnail generation
- Print support
- Download support
- Annotation rendering
- Form field support
- Signature display
- Attachment extraction
- Use directly with React
- Or use react-pdf wrapper
- Manual canvas integration
- Hooks-based implementation
- State management
- Sandbox environment
- Safe rendering
- XSS protection
- Content Security Policy compatible
- All modern browsers
- IE11 with polyfills
- Mobile browsers
- Safari iOS
- Chrome Android
- Custom rendering pipeline
- Text layer styling
- Canvas manipulation
- Custom fonts
- Custom CMaps
- PDF viewers
- Document management systems
- E-learning platforms
- Digital publishing
- Form filling applications
- Invoice systems
- PDF 1.0 through 2.0
- Encrypted PDFs
- Tagged PDFs
- PDF/A
- Linearized PDFs
- XFA forms (limited)
Free and open-source under the Apache 2.0 license.