npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dasch-ng/pdf-viewer

v11.0.0-rc.0

Published

Angular standalone component for rendering PDF documents (fork of ng2-pdf-viewer)

Readme

@dasch-ng/pdf-viewer

Angular standalone component for rendering PDF documents with pdf.js. Drop-in replacement for ng2-pdf-viewer updated for Angular 21+, the signals API, zoneless change detection, and pdfjs-dist 5.

📚 Full documentation: dasch.ng/libraries/pdf-viewer 🎮 Live demo: dasch.ng/demos/pdf-viewer/ 🔗 API reference: dasch.ng/api/@dasch-ng/pdf-viewer/

Install

npm install @dasch-ng/pdf-viewer
# or
bun add @dasch-ng/pdf-viewer

Quick start

import { Component } from '@angular/core';
import { PdfViewerComponent } from '@dasch-ng/pdf-viewer';

@Component({
  selector: 'app-pdf',
  imports: [PdfViewerComponent],
  template: ` <pdf-viewer [src]="'/assets/sample.pdf'" [render-text]="true" [original-size]="false" style="width: 100%; height: 600px;" /> `,
})
export class PdfComponent {}

Migration from ng2-pdf-viewer

Only the package name changes. Template API (selector, attributes, events) is preserved:

- import { PdfViewerComponent } from 'ng2-pdf-viewer';
+ import { PdfViewerComponent } from '@dasch-ng/pdf-viewer';

If you are migrating from the v10 PdfViewerModule, switch to the standalone PdfViewerComponent:

- import { PdfViewerModule } from 'ng2-pdf-viewer';
+ import { PdfViewerComponent } from '@dasch-ng/pdf-viewer';

Worker location

pdf.js parses PDFs in a Web Worker. The worker file is shipped by pdfjs-dist (which is a transitive dependency of this library) — it is not bundled into @dasch-ng/pdf-viewer itself.

Default (zero config): the component loads the worker from https://cdn.jsdelivr.net/npm/pdfjs-dist@<version>/legacy/build/pdf.worker.min.mjs. Fine for prototyping but a third-party request — for GDPR/offline-friendly production, self-host instead.

Self-host (recommended for production):

  1. Add the worker file to your app's angular.json assets:

    {
      "glob": "pdf.worker.min.mjs",
      "input": "node_modules/pdfjs-dist/legacy/build",
      "output": "assets/pdfjs"
    }
  2. Point the component at it before bootstrap, e.g. in main.ts:

    (window as any).pdfWorkerSrc = '/assets/pdfjs/pdf.worker.min.mjs';
    bootstrapApplication(AppComponent, { providers: [...] });

See the docs site for the version-pinned override variant and the full rationale.

Credits

Fork of ng2-pdf-viewer by Vadym Yatsyuk (@VadimDez) and its many contributors. The Angular 21 / pdfjs-dist 5 / signals upgrade was contributed by Luqman-Ud-Din Muhammad in VadimDez/ng2-pdf-viewer#1228. Full upstream git history is preserved in this monorepo.

License

MIT