@subedigaurav/ngx-pdf-viewer
v0.0.2
Published
Headless PDF viewer library for Angular applications.
Downloads
27
Maintainers
Readme
ngx-pdf-viewer
Headless PDF viewer library for Angular applications.
Features
- Angular 21+ — Built for modern Angular applications
- Lightweight — Minimal dependencies, optimized bundle size
- Type-safe — Full TypeScript support
- Standalone — Uses Angular standalone components (no NgModules required)
Installation
pnpm add @subedigaurav/ngx-pdf-viewerOr with npm:
npm install @subedigaurav/ngx-pdf-viewerPeer Dependencies
Ensure you have the following peer dependencies installed:
@angular/common^21.1.0@angular/core^21.1.0pdfjs-dist^5.4.0 (optional — loads from CDN if not installed)
Usage
Import the standalone component in your Angular application:
import { PdfViewerComponent } from '@subedigaurav/ngx-pdf-viewer';
@Component({
selector: 'app-document-viewer',
standalone: true,
imports: [PdfViewerComponent],
template: `<ngx-pdf-viewer [src]="pdfSrc"></ngx-pdf-viewer>`,
})
export class DocumentViewerComponent {
pdfSrc = 'https://example.com/document.pdf';
}License
MIT
