1.1.0 • Published 6 months ago
ngx-pdf-previewer v1.1.0
NgxPdfPreviewer
As its name indicates, this is a library for viewing pdf files in Angular projects.
Getting started
For now, NgxPdfRreviewer can be installed using npm :
npm install ngx-pdf-previewer
Then, it's simple to include it in your Angular components:
- Import the
PdfViewerComponent
in your component :
import { PdfViewerComponent } from "ngx-pdf-previewer";
- Add it to the
imports
array of your component:
// ...
// import { PdfViewerComponent } from 'ngx-pdf-previewer';
@Component({
selector: 'app-root',
standalone: true,
imports: [PdfViewerComponent],
// templateUrl: ``
})
// ...
- After that, in your component' HTML template use :
<lib-pdf-viewer src="assets/law.pdf" [zoom]="1"></lib-pdf-viewer>
The src
specifies the path to your Pdf file with the zoom
level.
Note that
zoom
is a number and not a string. The default value for zoom is1.5