@hhangular/pdfjs
TypeScript icon, indicating that this package has built-in type declarations

2.0.39 • Public • Published

@hhangular/pdfjs Build Status

Full documentation available here : hhangular/pdfjs

This library was generated with Angular CLI version 8.0.0.

You can read how here

This library contains an angular module PdfjsModule that contains a collection of components.

Components of PdfjsModule are implementation of mozilla pdfjs for angular 8x.

It contains some components for use easily the mozilla pdf viewer pdfjs.

dependencies

  • pdfjs-dist
  • @types/pdfjs-dist

Installation

npm install @hhangular/pdfjs --save

Configuration

Add assets pdfworker in angular.json

{
  ...
  "projects": {
    "YOUR PROJECT": {
      ...
      "architect": {
        "build": {
          ...
          "options": {
            ...
            "assets": [
              { 
                "glob": "pdf.worker.js", 
                "input": "./node_modules/pdfjs-dist/build", 
                "output": "/assets" 
              },
              ...

In modules using pdfModule, import PdfjsModule and configure worker

@NgModule({
...
imports: [
    BrowserModule,
    SharedModule,
    PdfjsBoxModule.config({workerSrc: 'assets/pdf.worker.js'})
  ],
...
  bootstrap: [AppComponent]
})
export class AppModule {
}

The best way is use SharedModule and export PdfjsModule. Like this you have just to import SharedModule in others modules.

@NgModule({
  imports: [
    CommonModule,
    PdfjsModule.forRoot({workerSrc: 'assets/pdf.worker.js'}),
  ],
  exports: [
    PdfjsModule,
  ],
  declarations: [],
})
export class SharedModule {
}

Components

  • pdfjs-thumbnails : Thumbnails of pdf
  • pdfjs-view : A single page of pdf

Control

  • PdfjsControl : Allow control pdf
  • PdfjsGroupControl : Allow control multi PdfjsControl

objects

  • PdfPage : Represents a pdf page serialisable, usefull for implement features on backend

Package Sidebar

Install

npm i @hhangular/pdfjs

Weekly Downloads

96

Version

2.0.39

License

MIT

Unpacked Size

2.32 MB

Total Files

77

Last publish

Collaborators

  • hhfrancois