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 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-pdf-canvas-viewer-pkg

v0.1.2

Published

A Vue 3 component to preview PDF files using canvas (based on pdfjs-dist)

Downloads

334

Readme

Vue PDF Canvas Viewer

Un composant Vue 3 pour prévisualiser des fichiers PDF dans un canvas, basé sur pdfjs-dist. Il permet de naviguer entre plusieurs fichiers, de prévisualiser le contenu, de télécharger le PDF et de personnaliser les dimensions et styles du rendu.

Installation

Installez le package ainsi que ses dépendances de pair :

npm install vue-pdf-canvas-viewer-pkg pdfjs-dist vue

Usage simple

<script setup lang="ts">
import "vue-pdf-canvas-viewer-pkg/dist/style.css";
import PdfPreview from "vue-pdf-canvas-viewer-pkg";

const urls = [
  "https://exemple.com/fichier1.pdf",
  "https://exemple.com/fichier2.pdf"
];
</script>

<template>
  <div style="max-width: 600px; margin: 40px auto;">
    <PdfPreview :pdf-urls="urls" />
  </div>
</template>

Props disponibles

| Prop | Type | Défaut | Description | | --- | --- | --- | --- | | pdfUrls | string[] | [] | Tableau d’URLs des fichiers PDF à afficher | | width | string | "100%" | Largeur du container/canvas | | height | string | "350px" | Hauteur du container/canvas | | canvasBorder | string | "1px solid #e5e7eb" | Style de la bordure du canvas | | downloadColor | string | "#2563eb" | Couleur du bouton de téléchargement |


Fonctionnalités

  • Rendu Canvas : Prévisualisation performante des PDF via l'API Canvas.
  • Navigation multi-fichiers : Système de slider intégré pour passer d'un document à l'autre.
  • Téléchargement : Bouton natif pour récupérer le fichier PDF actuellement affiché.
  • Responsive : Adaptation automatique à la largeur du conteneur parent.
  • Personnalisation : Contrôle des dimensions et des couleurs via les props.

CSS et Dépendances

Style

Le style par défaut doit être importé manuellement dans votre composant ou votre fichier d'entrée principal :

import "vue-pdf-canvas-viewer-pkg/dist/style.css";

Peer Dependencies

Ce composant nécessite les bibliothèques suivantes pour fonctionner correctement :

  • Vue 3
  • pdfjs-dist

Licence

MIT