npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@teamhive/pdf-viewer

v5.0.0

Published

PDF Viewer Web Component. Built with stencil and pdfjs.

Downloads

1,531

Readme

Built With Stencil

Hive PDF Viewer

This web component allows you to add PDF rendering support to your web applications.

Features

  • Rendering PDFs on web (Angular, Ionic, React, Stencil, etc.)
  • Search
  • Fit to Page / Fit to Width
  • Side panel for quick thumbnail navigation

Installation

  • npm i @teamhive/pdf-viewer

Usage

<hive-pdf-viewer src="http://www.mydomain.com/example.pdf"></hive-pdf-viewer>

Somewhere in your project (e.g. main.ts):

import { defineCustomElements } from '@teamhive/pdf-viewer/dist/loader';
defineCustomElements(window);

Angular

Add viewer assets to angular.json assets block:

{
    "projects": {
        "app": {
            "architect": {
                "build": {
                    "options": {
                        "assets": [
                            {
                                "glob": "**/*",
                                "input": "node_modules/@teamhive/pdf-viewer/dist/pdf-viewer/pdf-viewer-assets",
                                "output": "pdf-viewer-assets"
                            }

Follow the Stencil JS Framework Integration guide for more info.

Properties

|Property|Default|Description :---:|:---:|:---: |src||The PDF web address location (http, https)| |page|1|The default page index.| |enableToolbar|true|If the toolbar is available for display.| |enableSideDrawer|true|If the side drawer UI (and button) is available for display.| |enableSearch|true|If the document can be searched through. Hides the button when false.|

Events

|Event|Description| :---:|:---: |linkClick(href: string)|Emits the href clicked when it's not an internal document annotation.| |pageChange(currentPage: number)|Emits the current page number when the current page changes.|


Contributors

| | | :---:|:---:|:---: |Sean Bannigan|Sean Perkins|Justin True