You can get the PDF viewer up and running in roughly two minutes. You need node.js, npm and a current version of Angular. This library aims to be compatible to the last four versions of Angular, which gives you two years time to update.
With very few exceptions, I only maintain the most current version of the viewer. As much as I'd like to provide bug fixes to older versions, I don't have enough time to spare.
The instructions below assume you've already got an Angular project. If you haven't, here's what to do:
npm i -g @angular/cli
.ng new my-favorite-project
.I've described these steps in more detail here.
ng add ngx-extended-pdf-viewer@latest
@latest
by the version number you need. @latest
gets you the newest stable version. If you omit @latest
, Angular tries to detect the latest compatible version. Note that this may be an alpha version. Usually these alpha version are useful, too, but they ship without promises. By definition, an alpha version is a version that might be broken.<app-example-pdf-viewer>
to your <app-component>
to display the PDF file.After that, you'll probably want to delete the example PDF file and move the code out of the example component.