Gathering detailed insights and metrics for ngx-extended-pdf-silicon-valley-viewer
Gathering detailed insights and metrics for ngx-extended-pdf-silicon-valley-viewer
Gathering detailed insights and metrics for ngx-extended-pdf-silicon-valley-viewer
Gathering detailed insights and metrics for ngx-extended-pdf-silicon-valley-viewer
A full-blown PDF viewer for Angular 16, 17, and beyond
npm install ngx-extended-pdf-silicon-valley-viewer
Typescript
Module System
Node Version
NPM Version
20.0.0
Updated on Apr 25, 2024
Update to pdf.js 4.0
Updated on Feb 07, 2024
18.0.0
Updated on Sep 19, 2023
17.4.7
Updated on Sep 16, 2023
Version 16: PDF editor and smooth zooming
Updated on Feb 05, 2023
Version 15.0: pdf.js 2.6; support for AMD modules; bugfixes
Updated on Sep 11, 2022
Fluent (81.92%)
TypeScript (11.02%)
SCSS (3.2%)
CSS (1.88%)
HTML (1.38%)
JavaScript (0.57%)
Shell (0.02%)
Dockerfile (0.01%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
536 Stars
2,377 Commits
205 Forks
10 Watchers
15 Branches
38 Contributors
Updated on Jul 13, 2025
Latest Version
2.1.91
Package Id
ngx-extended-pdf-silicon-valley-viewer@2.1.91
Unpacked Size
45.65 MB
Size
17.41 MB
File Count
1,180
NPM Version
10.8.1
Node Version
20.15.1
Published on
Apr 14, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
2
This library provides an embeddable PDF viewer component. It's different from other approaches like ng2-pdf-viewer in that it shows the full suite of UI widgets. In other words, it strongly resembles the PDF viewer of your browser:
Version 18 ships with quite a few improvements:
[pageViewMode]
, [scrollMode]
, and [spreadMode]
,A slightly modified layout is a side-effect of the improvements of the toolbar and the secondary menu. Most people won't notice, but if you're using screenshot tests, expect them to break.
The updated find API brings a couple of breaking changes. I removed the fuzzy search, the multiple words-search, and the current page / page range search. "Ignore accent" now is "match diacritics." When you migrate your code, you'll have to invert your boolean logic because "ignore accents" is the opposite of "match diacritics". Along the way, I noticed that the find API didn't work as expected. I fixed several bugs and added more fields to the events. If you rely on the old events, brace yourself for (minor) breaking changes. Plus, I've renamed, moved, and even removed a couple of classes to make the new file structure match the simplified find bar.
The breaking changes became nessary because maintaining the library became more time-consuming with each version of pdf.js. Even worse, the pdf.js team worked heavily on the find algorithm, but I wasn't able to merge their improvements during the last one or two years. So I had to reduce the differences between the libraries. In other words, I pruned ngx-extended-pdf-viewer. I'm positive I've finished pruning, so in the future, there will be fewer breaking changes. Please apologize for the inconvenience!
If you need the old extended find bar, please stick to version 17. I've split off a separate branch, so I can maintain version 17 in parallel for a while.
A small breaking change affects single-page mode. I've removed a CSS rule that pushed the page to the left. If you don't like the page to be centered, you can add the CSS rules in your global style.css
:
1.pdfViewer.singlePageView .page { 2 margin: 0; 3}
There's also a detailed changelog.
There's a showcase at https://pdfviewer.net. Check this page for live demos, source code examples, and a handbook.
Would you like to participate in a popular open source-project? It's easy: just open a ticket so we can discuss the change, create a fork, and send me a pull request. Contributions to the showcase are as welcome as contributions to the core library.
Not to mention the ability to display PDF files, running on a customized version of Mozilla's pdf.js 3.10, released in late August 2023. If you're the daring one, you can also use the developer version 3.11. It's bleeding edge, so use it at your own risk. Basically, the bleeding edge version helps me because I can add Mozilla's latest improvements in frequent, tiny increments. But every once in a while, it contains a feature you may need, so feel free to use it. I don't encourage using the "bleeding edge" branch in production, but the quality is usually production-ready.
Even I have to admit my pet project doesn't match every requirement. There are several alternatives out there. Feel free to expand the description to learn what other developers have in store for you:
There's also a direct counterpart to my library: ng2-pdfjs-viewer. As far as I can see, it's also a good library. As of May 2021, it's running on PDF.js 2.2.171. It wraps the PDF viewer in an iFrame. That's a more reliable approach, but it also offers fewer options. The list of attributes is shorter, and the PDF viewer can't emit events to your application. If you're not happy with my library, check out ng2-pdfjs-viewer. It's a good library, too. Its unique selling point is displaying multiple PDF files simultaneously on the same page.
You might also try to use the native PDF viewer of your browser. That's a valid approach. It's even the preferred approach. However, ngx-extended-pdf-viewer
gives you a wide range of options that aren't available using the native API.
As a rule of thumb, I recommend cloning the showcase project from GitHub before doing anything else. It's a standard Angular CLI application, so you'll get it up and running in less than ten minutes. It's a good starting point to do your experiments. Maybe even more important: you'll learn whether the library works on your machine. (Of course, it does, but it's always good to double-check!)
Currently, the minimum required version is Angular 12. The idea is to support the four most current versions of Angular, which gives you roughly two years to update. However, supporting so many versions isn't always possible.
npm add ngx-extended-pdf-viewer
and accept all the defaults1<ngx-extended-pdf-viewer [src]="'assets/example.pdf'" useBrowserLocale="true"></ngx-extended-pdf-viewer>
If you're running a non-standard configuration, have a look at the getting-started page" of the showcase.
See the attribute list on the showcase and the list of default options page. The lists have become too long to put them here: 87 @Input()
attributes, 25 event emitters, and 50 default options, give or take a few.
Missing a configuration option? File an issue on the project bug tracker. If your request makes sense to me and if I can implement it in my (limited) leisure time, I'll add it. BTW, you can speed up the process by providing a code snippet telling me how to implement the feature or by submitting a pull request.
The service NgxExtendedPdfViewerService
offers a programmatic API for searching, printing, dealing with layers, and scrolling within the page.
If you add the translation files to your project as described above in step 3, the PDF viewer uses the browser language setting to determine which language to load. First, it loads the locale.properties,
scans it for the desired language files, and loads the language file from the corresponding folder. That's two additional HTTP calls.
Don't forget to set the attribute useBrowserLocale="true"
if you follow this approach.
If you want to use the slow way but prefer to load the language files from a different URL, add a link to your application like so:
1<link rel="resource" type="application/l10n" href="https://www.example.com/locale/locale.properties" />
In this case, don't set useBrowserLocale
(or set it explicitly to false).
Alternatively, you can provide the translations as a Json file. This Json file has to be part of an HTML page. That's especially useful if you need only one or two languages. To get familiar with this approach, embed the Json file in the index.html
like so:
1<script type="application/l10n"> 2 {"default_locale":"de","locales":{"de": ... }} 3</script>
The folder node_modules/ngx-extended-pdf-viewer/assets/inline-locale-files
contains snippet files you can copy into your HTML page.
Hint: You can add the language definition in an arbitrary HTML file. The bottom line is that the HTML snippet is already part of the DOM when the PDF viewer is initialized. Cluttering the root index file with the translations is an ugly and inflexible hack, but it works.
If you use the "inline" approach, don't set useBrowserLocale
(or set it explicitly to false
).
Pull requests and bug reports are welcome. Please send them to the bug tracker of the project page: https://github.com/stephanrauh/ngx-extended-pdf-viewer/issues
Have a look at this walkthrough.
The license of the ngx-extended-pdf-viewer
is the Apache V2 license.
The library is based on https://github.com/mozilla/pdf.js, which has been published under an Apache V2 license.
Some of the default icons have been published under a SIL Open Font License 1.1 license at Material Design Icons. The other icons have either been published under an Apache V2 license by Google or by the pdf.js team at Mozilla.
Thanks to the awesome pdf.js team and all the users who've reported bugs and even sent me pull requests!
Reluctantly, I have to drop support for Internet Explorer 11. The base library, Mozilla's pdf.js, now generates binaries no longer compatible with Internet Explorer 11, and it seems there's no easy fix. That's a pity because IE11 support was the original use-case of the library and because I frequently get messages from developers who need IE11 support. The last version known to be compatible is 5.3. Version 7.3.2 should be compatible, too, but a user reported crashes.
No vulnerabilities found.
Reason
30 commit(s) and 29 issue activity found in the last 90 days -- score normalized to 10
Reason
security policy file detected
Details
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
SAST tool is run on all commits
Details
Reason
6 existing vulnerabilities detected
Details
Reason
Found 2/29 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More