Giter VIP home page Giter VIP logo

nano-pdf-book-viewer's Introduction

NanoPdfBookViewer

A small PDF viewer in shape of a book for Angular Angular 13^

Set up

  1. Install the dependency
npm install --save nano-pdf-book-viewer
  1. Add PDF JS scripts to your project so we can load the pdfs
"scripts": [
  "node_modules/nano-pdf-book-viewer/scripts/pdf.2-11-338.worker.min.js",
  "node_modules/nano-pdf-book-viewer/scripts/pdf.2-11-338.min.js"
]
  1. Import the module in your AppModule
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { NanoPdfBookViewerModule } from 'nano-pdf-book-viewer';
import { AppComponent } from './app.component';

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

NanoPdfBookViewerComponent properties

  • [pdfSrc] set this property to point to the PDF you'd like to load. Changing this property will result in loading the new PDF. Note that this value needs to be a valid URL
  • [pageNumber] allows the developer to set the current page. It always performs the animation.
  • (loading) emits true and false based on the state of the component; Downloading PDF, Rendering, etc. Once it's done rendering emits true.
  • (pdfPageCount) emits the total number of pages once the PDF has been downloaded and parsed.

nano-pdf-book-viewer's People

Contributors

nanospicer avatar rdrtrifork avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

rdrtrifork

nano-pdf-book-viewer's Issues

Local Pdf

I am trying to integate nano-pdf-book-viewer in an ionic cordova angular mobile app.
I want to store my pdf inside src/assets, not somewhere in the web. Is there a workaround to add it in pdfSrc as a filepath because it seems to work only with url and downloading from a remote or local server.
Also if i upload it somewhere in my server i get CORS errors.
Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.