
Security News
Open Source Maintainers Feeling the Weight of the EUβs Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
ngx-extended-pdf-viewer
Advanced tools
Embedding PDF files in your Angular application. Highly configurable viewer including the toolbar, sidebar, and all the features you're used to.
Welcome to ngx-extended-pdf-viewer
β a powerful, full-featured PDF viewer for Angular applications. Whether you're building enterprise tools or internal utilities, this library gives you the control and customization options you need, all while preserving a native-like viewing experience.
Built on Mozillaβs pdf.js and extended with dozens of enhancements, it's ideal for serious applications that demand more than just basic PDF display.
The library requires Angular 17+. Older versions are not supported.
In general, I aim to support the last four Angular versions (roughly two years of updates), but this may not always be feasible. For example, the upcoming version 25 might raise the minimum required Angular version significantly: I plan to support modern Angular (and I know many of you are waiting for that). You can't have an omelette without breaking an egg.
Install via npm:
npm add ngx-extended-pdf-viewer
In your component HTML:
<ngx-extended-pdf-viewer [src]="'assets/example.pdf'"></ngx-extended-pdf-viewer>
For NgModule-based applications:
import { NgxExtendedPdfViewerModule } from 'ngx-extended-pdf-viewer';
@NgModule({
imports: [NgxExtendedPdfViewerModule],
})
export class AppModule {}
For standalone components (Angular 17+):
import { Component } from '@angular/core';
import { NgxExtendedPdfViewerModule } from 'ngx-extended-pdf-viewer';
@Component({
selector: 'app-pdf-viewer',
standalone: true,
imports: [NgxExtendedPdfViewerModule],
template: `<ngx-extended-pdf-viewer [src]="'assets/example.pdf'"></ngx-extended-pdf-viewer>`,
})
export class PdfViewerComponent {}
Or configure in main.ts for application-wide availability:
import { bootstrapApplication } from '@angular/platform-browser';
import { importProvidersFrom } from '@angular/core';
import { NgxExtendedPdfViewerModule } from 'ngx-extended-pdf-viewer';
bootstrapApplication(AppComponent, {
providers: [
importProvidersFrom(NgxExtendedPdfViewerModule),
// other providers...
],
});
π§ For hands-on examples and step-by-step guides, visit the showcase and the getting started page.
Version 20.0.2
fixes a critical security vulnerability (CVE-2024-4367). Update to this version or newer to stay safe from exploits via malicious PDF files.
Thanks to GitHub users ScratchPDX and Deepak Shakya for reporting the issue promptly.
zone.js
(maybe)Expect some breaking changes β but better performance and modern Angular support await!
Regarding security: I'm not perfect - it's always a best-effort approach without guarantees. I'm 100% committed, but I need your help, and even so, in the long run, errors are invevitable. The art is to close vulnerabilities before a hacker can exploit then - and that's a joint effort. Together, we'll manage. Don't hesitate to report bugs and vulnerabilities as soon as possible!
See the full list of features on the showcase site.
Version 24.2.0 and above:
enablePageReordering
option allows users to reorder PDF pages by dragging thumbnails. Enable it with pdfDefaultOptions.enablePageReordering = true;
.Version 24.1.0 and above: improved accessability by showing a hover effect when the mouse is over a button and by adding a blue ring to the active element, thus restoring the implementation we used to have a long time ago. Thanks to Megan for contributing this pull request!
Version 24.0.0:
pdf.js 5.3
[(formData)]
. In earlier versions, only the first field was changed. Kudos to Sebastien Fauvart for submitting this pull request!pdfDefaultOptions.enableSignatureEditor = true;
. Caveat: these signature are not cyptographic PDF signatures. At the time of writing (July 07, 2025), they're merely "stamp annotations".β Version 23 includes a CSS bug where search highlights may render text invisible. To work around this, add the following to your global styles.css
:
ngx-extended-pdf-viewer .textLayer .highlight.selected {
opacity: 0.25;
}
Remove this workaround after updating to 24.0.0+.
If you're stuck on a feature, try cloning the showcase repository. Itβs a clean and working example, and comparing it to your app often helps locate the issue. And if the showcase doesnβt work β you can blame me!
git clone https://github.com/stephanrauh/extended-pdf-viewer-showcase.git
cd extended-pdf-viewer-showcase
npm install
npm start
π Open a ticket here if somethingβs broken.
[inputs]
, events, and CSS hooks:
Use NgxExtendedPdfViewerService
for:
We want to hear from you!
π File issues here: GitHub Bug Tracker
If possible, include a code snippet or reproduction. Better yet β send a pull request!
I understand, but... realistically, I canβt maintain old versions in my spare time. The architecture allows for it, but I simply donβt have the bandwidth β unless something critical breaks.
If you're desperate for a fix or a new feature, thereβs one option: ask my employer. I work as an IT consultant, and they may be willing to sponsor time to work on ngx-extended-pdf-viewer during business hours.
If this library doesn't fit your needs:
ng2-pdf-viewer
: Minimal and lightweightng2-pdfjs-viewer
: iframe-based, supports multiple PDFsYour feedback matters!
Just keep it respectful β the ngx-extended-pdf-viewer community is a friendly place, and I want to keep it that way!
Still using IE11 in 2025? You're braver than most.
I hate to admit it - but I've dropped support years ago. The last known compatible version is 5.3. Use it at your own risk β no updates, no fixes, no guarantees.
FAQs
Embedding PDF files in your Angular application. Highly configurable viewer including the toolbar, sidebar, and all the features you're used to.
The npm package ngx-extended-pdf-viewer receives a total of 87,952 weekly downloads. As such, ngx-extended-pdf-viewer popularity was classified as popular.
We found that ngx-extended-pdf-viewer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.