1.3.0 • Published 6 years ago

bn-ng-pdf-viewer v1.3.0

Weekly downloads
11
License
MIT
Repository
github
Last release
6 years ago

DESCRIPTION

ANGULAR 6+ PDF VIEWER USING PDF JS. An easy to use stylish PDF Viewer for Angular 6+. It comes with a toolbar containing pagination/go to page and zooming options. (It supports angular 7 too)

INSTALLATION

npm install bn-ng-pdf-viewer --save

DOCUMENTATION

DOCUMENTATION

Content

USAGE

Import the bn-ng-pdf-viewer in the module

import { BnNgPdfViewerModule } from 'bn-ng-pdf-viewer';
....
...
imports: [
    ....,
    BnNgPdfViewerModule
]

Add the bn-ng-pdf-viewer selector in the component html

<bn-ng-pdf-viewer [showAll]="true" [PDF]="'http://www.africau.edu/images/default/sample.pdf'" [pageNo]="1" [styleClass]="my-viewer-class"></bn-ng-pdf-viewer>

OPTIONS

INPUT PROPERTIES

PDF

PropertyTypeRequired
PDFstringRequired

Pass PDF Source

[PDF]="'http://www.africau.edu/images/default/sample.pdf'"

pageNo

PropertyTypeRequired
pageNonumberOptional

Page number

[pageNo]="1"

showAll

PropertyTypeRequired
showAllbooleanOptional

Show all the pages

[showAll]="true"

styleClass

PropertyTypeRequired
styleClassbooleanOptional

Add custom css class to the PDF viewer

[styleClass]="my-custom-css"

enableDownload

PropertyTypeRequired
enableDownloadbooleanOptional

To enable download option in PDF viewer

[enableDownload]="true"

OUTPUT PROPERTIES

(PDFRender)

PropertyTypeRequired
PDFRenderstringOptional

PDF RENDER EMITS THREE VALUES: 1. 'LOADING' - It emits whenever a PDF Page is loading. 2. 'FINISHED' - It emits once the PDF page is successfully rendered. 3. 'ERROR' - It emits once an error occured while rendering the PDF page.

VERSIONING

1.1.0 - Show All pages option added 1.0.0 - Pagination, Zoom In, Zoom Out, Style Changes 0.0.2 - Angular 7 support added 0.0.1 - A simple angular 6 pdf viewer