Press "Enter" to skip to content

An Angular Component for PDFJS and ViewerJS | ng2-pdfjs-viewer

Angular PDFJS Viewer with Mozilla’s ViewerJS is a very simple angular component to view inline (embedded) or in new tab pdf files with a feature-rich viewer. Mozilla’s pdfjs viewer (v2.2.171) is used behind the scenes and supports Angular 2.0. Very lightweight, easiest to integrate and use, and most reliable, this library has only one dependency (@angular/core).

what’s new?

  • Direct access to the basic viewer-exposed PDFViewerApplication objects and PDFViewerApplicationOptions open a whole world of customizable PDFJS and ViewerJS properties and methods, allowing them to be changed programmatically; Resulting in a unique viewing experience.
  • Dynamic Page Number – Getter / Setter for page number added. Change the page number after uploading the document, or access the current page in the main component.
  • Event Support – You can now log various events like document loading, page change, before printing, after printing, etc. Please make sure you provide the viewerId for the events to function properly.

How to make use of it:


$ npm install ng2-pdfjs-viewer --save

And then configure it in your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';

import { PdfJsViewerModule } from 'ng2-pdfjs-viewer'; // <-- Import PdfJsViewerModule module

  declarations: [
  imports: [
    PdfJsViewerModule // <-- Add to declarations
  providers: [],
  bootstrap: [AppComponent]
export class AppModule { }

Angular 2+ PDF Viewer, Angular PDFJS viewer with Mozilla’s ViewerJS Plugin/Github

See Demo And Download

Official Website(intbot): Click Here

This superior jQuery/javascript plugin is developed by intbot. For extra advanced usage, please go to the official website.

Be First to Comment

    Leave a Reply

    Your email address will not be published.