This is a comprehensive PDF search application built with Angular that demonstrates different PDF libraries and their capabilities for searching text within PDF documents.
- Search for any text within PDF documents (default: "hello cortellis")
- Programmatic search functionality that can be dynamically changed
- Highlighted search results on PDF pages
- Search result count and page navigation
- Path:
/ng2-pdf-viewer - Features: Basic PDF rendering, search, zoom controls
- Pros: Easy to implement, good community support
- Cons: Limited customization, larger bundle size
- Path:
/pdfjs-direct - Features: Custom implementation with full control
- Pros: Lightweight, highly customizable, advanced search
- Cons: More complex implementation
- Path:
/pdf-lib - Features: PDF manipulation + rendering, metadata extraction
- Pros: Can modify PDFs, extract metadata, download with highlights
- Cons: Larger size, more complex
- Node.js (v20 or higher)
- npm or yarn
# Install dependencies
yarn install
# or
npm install
# Start the development server
yarn start
# or
npm start| Library | Bundle Size | Features |
|---|---|---|
| ng2-pdf-viewer | ~8MB | Basic rendering, search |
| PDF.js Direct | ~3MB | Custom implementation |
| PDF-lib + PDF.js | ~5MB | Advanced manipulation |