ng-pdf-renderer ๐
May 26, 2025 ยท View on GitHub
A modern, zero-configuration PDF viewer for Angular applications with intelligent auto-fit, text selection, and responsive design.
๐ Quick Start
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';
}
โจ Features
- ๐ 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
๐ Documentation
For complete documentation, examples, and configuration options, see the full README.
๐๏ธ Development
This repository contains:
- Library:
./projects/ng-pdf-renderer/- The npm package source - Test App:
./projects/pdf-test-app/- Development testing application
Build & Test
# 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
๐ License
MIT ยฉ askinjohn