A modern, zero-configuration PDF viewer for Angular applications with intelligent auto-fit, text selection, and responsive design.
npm install ng-pdf-renderer
import { Component } from '@angular/core';
import { PdfViewerComponent } from 'ng-pdf-renderer';
@Component({
selector: 'app-pdf-demo',
standalone: true,
imports: [PdfViewerComponent],
template: `<ng-pdf-viewer [src]=\"pdfUrl\"></ng-pdf-viewer>`
})
export class PdfDemoComponent {
pdfUrl = '/assets/document.pdf';
}
- 🚀 Zero Configuration - Works out of the box
- 📱 Auto-Fit & Responsive - Adapts to any container size
- 📝 Text Selection - Copy text directly from PDFs
- 🔍 Search, Print, Download - Built-in functionality
- 🎯 Modern Angular - Standalone components, Angular 19+
- 🛠️ Auto PDF.js Setup - No manual configuration needed
For complete documentation, examples, and configuration options, see the full README.
This repository contains:
- Library:
./projects/ng-pdf-renderer/
- The npm package source - Test App:
./projects/pdf-test-app/
- Development testing application
# Install dependencies
npm install
# Build the library
ng build ng-pdf-renderer
# Run test application
ng serve pdf-test-app
# Publish to npm
npm publish dist/ng-pdf-renderer
MIT © askinjohn