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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ngx-universal-file-viewer

v2.0.3

Published

A powerful Angular component for viewing PDF, Word, Excel, and PowerPoint files with continuous scroll and page-by-page view modes. Supports Angular 12+

Readme

NgxUniversalFileViewer

npm version License: MIT Angular

A powerful and versatile Angular component for viewing multiple file formats including PDF, Word (DOC/DOCX), Excel (XLS/XLSX), and PowerPoint (PPT/PPTX) files with both continuous scroll and page-by-page view modes.

✨ Features

  • 📄 PDF Viewer - Full-featured PDF viewing with zoom, rotation, navigation
  • 📝 Word Documents - Display DOC and DOCX files with proper formatting
  • 📊 Excel Spreadsheets - View XLS and XLSX files with sheet navigation
  • 📽️ PowerPoint Presentations - View PPT and PPTX slides
  • 🔄 Dual View Modes - Toggle between continuous scroll and page-by-page view
  • 🎨 Customizable Toolbar - Configure which controls to display
  • 📱 Responsive Design - Works seamlessly on desktop and mobile devices
  • 🔍 Auto File Type Detection - Automatically detects file type from extension
  • 🌐 SSR Compatible - Works with Angular Universal
  • 💪 TypeScript Support - Fully typed for better development experience

📦 Installation

Step 1: Install the package

npm install ngx-universal-file-viewer

Or Using Yarn:

yarn add ngx-universal-file-viewer

🚀 Getting Started For Angular 14+ (Standalone Components)

import { Component } from '@angular/core';
import { NgxUniversalFileViewerComponent   } from 'ngx-universal-file-viewer';

@Component({
  selector: 'app-document-viewer',
  standalone: true,
  imports: [NgxUniversalFileViewerComponent],
  template: `
    <ngx-universal-file-viewer
      [src]="fileUrl"
      [fileType]="'auto'"
      [viewMode]="'continuous'">
    </ngx-universal-file-viewer>
  `
})
export class DocumentViewerComponent {
  fileUrl = 'assets/sample.pdf';
}

For Angular 12-13 (Module-based)

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { NgxUniversalFileViewerComponent  } from 'ngx-universal-file-viewer';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    NgxUniversalFileViewerModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

📖 Basic Usage Simple Implementation

<ngx-universal-file-viewer
  [src]="fileUrl"
      [fileType]="'auto'"
      [viewMode]="'continuous'"
      [showToolbar]="true"
      >
</ngx-universal-file-viewer>

TypeScript

export class AppComponent {
  fileUrl = 'https://example.com/document.pdf';
}

With All Options

<ngx-universal-file-viewer
  [src]="fileSource"
  [fileType]="fileType"
  [viewMode]="viewMode"
  [showToolbar]="showToolbar"
  [viewerConfig]="viewerConfig"
  [toolbarConfig]="toolbarConfig"
  (onLoad)="handleLoad($event)"
  (onError)="handleError($event)"
  (pageChange)="handlePageChange($event)"
  (viewModeChange)="handleViewModeChange($event)">
</ngx-universal-file-viewer>

📱 Mobile Support

The viewer is fully responsive and works on mobile devices:

Touch gestures for scrolling
Pinch to zoom (PDF)
Responsive toolbar
Optimized for small screens
🔒 Security
Sanitizes HTML content for Word documents
Validates file types
Secure handling of file sources
No external dependencies for sensitive operations

🐛 Troubleshooting

Issue: PDF not loading
Solution: Ensure PDF.js is properly loaded:

🙏 Acknowledgments

PDF.js - PDF rendering
Mammoth.js - Word document conversion
SheetJS - Excel file processing

📞 Support

For support, email [email protected]..