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-pdfz

v1.0.1

Published

A customizable, i18n-ready, SSR-safe PDF viewer for Vue

Readme

vue-pdfz

A customizable, i18n-ready, SSR-safe PDF viewer for Vue

npm Version npm Downloads GitHub Stars License

Documentation • API Reference • Live Demo

Features

  • 🧭 Navigation – UI and keyboard navigation, continuous / single / facing layouts.
  • 🔍 Zoom & Rotation – discrete presets + free zoom, fit modes, scroll & pinch zoom.
  • 🖼 Thumbnails – lazily rendered, collapsible.
  • 🔎 Text Search – cross-page matching and highlighting.
  • 🖨 Print & Download – whole document, with filled form values baked in.
  • 📝 Annotations & Forms – annotation layer, interactive AcroForms, internal/external links.
  • 🔒 Passwords – built-in prompt for encrypted PDFs.
  • 🌍 i18n – typed translations, 9 built-in + custom locales, optional vue-i18n adapter, RTL.
  • 📱 Responsiveness – container-driven, compact toolbar + thumbnails drawer on narrow widths.
  • 🎨 Theming – custom design tokens, light / dark / auto modes, deep slot overrides.
  • ♿ Accessibility – keyboard shortcuts, ARIA roles & labels.
  • ⚡ Performance – lazy + virtualized page rendering.
  • 🧩 Compatibility – typed, tree-shakeable ESM (+ CJS), SSR/Nuxt-safe.

Installation

npm install vue-pdfz

Usage

<script setup>
import { PdfViewer } from 'vue-pdfz'
import 'vue-pdfz/style.css'
</script>

<template>
  <PdfViewer source="/document.pdf" />
</template>

Props

| Prop | Type | Default | Description | | -------------------- | --------------------------------------------------------- | ----------------------- | --------------------------------------------------------------------------- | | annotationLayer | boolean | true | Render the annotation layer. | | enableDownload | boolean | true | Show the download action. | | enableKeyboard | boolean | true | Enable keyboard shortcuts. | | enablePrint | boolean | true | Show the print action. | | enableSearch | boolean | true | Enable text search. | | forms | boolean \| 'readonly' | false | Interactive AcroForm fields; 'readonly' renders them non-editable. | | imageResourcesPath | string | – | URL path to PDF.js annotation icon assets. | | layout | 'continuous' \| 'facing' \| 'single' | 'continuous' | Page layout mode. | | lazy | boolean | true | Defer per-page rendering until near the viewport. | | linkRel | string | 'noopener noreferrer' | rel attribute for external links. | | linkTarget | '_blank' \| '_parent' \| '_self' \| '_top' | '_blank' | target attribute for external links. | | locale | string | plugin / 'en' | Active UI locale code. | | maxZoom | number | 10 | Maximum zoom scale. | | messages | Partial<LocaleMessages> | – | Per-instance string overrides. | | minZoom | number | 0.1 | Minimum zoom scale. | | page | number | 1 | Current page number. v-model:page. | | rotation | 0 \| 90 \| 180 \| 270 | 0 | Rotation in degrees. v-model:rotation. | | searchControls | { caseSensitive?: boolean, entireWord?: boolean } | – | Which search toggles to show (hidden by default). | | shortcuts | KeyboardShortcuts | – | Override key bindings per action. | | showThumbnails | boolean \| 'auto' | 'auto' | Thumbnails sidebar; 'auto' opens on wide containers, false disables it. | | showToolbar | boolean | true | Show the toolbar. | | source | string \| URL \| ArrayBuffer \| Uint8Array \| PdfSource | – | The PDF to load: URL, binary, or config object. | | textLayer | boolean | true | Render the selectable text layer (required for search). | | theme | 'light' \| 'dark' \| 'auto' | 'light' | Color-scheme mode. | | themeTokens | ThemeTokens | – | Design-token overrides. | | thumbnailWidth | number | 120 | Thumbnail render width in px. | | virtualization | boolean | false | Windowed page rendering for large documents. | | zoom | number \| 'auto' \| 'page-fit' \| 'page-width' | 'auto' | Zoom level or fit mode. v-model:zoom. | | zoomStep | number | 0.25 | Step for zooming in/out. |

Events

| Event | Payload | | ------------------------------------------------- | ----------------------------- | | annotation-click | AnnotationClickPayload | | error | PdfError | | form-change | FormChangePayload | | link-click | LinkClickPayload | | loaded | PdfDocumentMeta | | loading-progress | LoadingProgress | | page-change | number (page) | | password-incorrect | – | | password-required | – | | rendered | number (page) | | rotation-change | Rotation | | search-result | SearchResult | | update:page / update:rotation / update:zoom | v-model updates | | zoom-change | ZoomValue, number (scale) |

Slots

| Slot | Scope | Purpose | | -------------------------------------------------- | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | empty | – | Empty-state overlay. | | error | { error, retry } | Error overlay. | | icon-* | – | icon-prev, icon-next, icon-zoom-in, icon-zoom-out, icon-rotate-cw, icon-search, icon-print, icon-download, icon-thumbnails | | loading | { progress } | Loading overlay. | | page-overlay | { pageNumber, scale } | Per-page watermarks / badges. | | password | { submit, error } | Password prompt overlay. | | search-bar | { total, current, search, next, prev, close } | Custom search UI. | | thumbnail | { isActive, page, src } | Per-thumbnail item. | | thumbnails | { goToPage, page, pageCount } | Full sidebar replacement. | | toolbar-start / toolbar-center / toolbar-end | – | Replace a toolbar region. | | toolbar | { page, pageCount, rotation, scale } | Full toolbar replacement. |

Exposed Methods

const viewer = ref<InstanceType<typeof PdfViewer>>()
viewer.value.goToPage(1)
viewer.value.nextPage()
viewer.value.prevPage()
viewer.value.setZoom(1)
viewer.value.zoomIn()
viewer.value.zoomOut()
viewer.value.rotate('cw')
await viewer.value.search('foo')
viewer.value.nextMatch()
viewer.value.prevMatch()
viewer.value.clearSearch()
await viewer.value.print()
await viewer.value.download('report.pdf')

Internationalization

Resolution order for any string: per-component messages → plugin messages → built-in bundle for locale → en fallback.

Override individual strings

<PdfViewer :messages="{ download: 'Save' }" />

Add a locale

import { PdfViewer, type LocaleMessages } from 'vue-pdfz'
import { en } from 'vue-pdfz/locales/en'

const it: LocaleMessages = { ...en, nextPage: 'Pagina successiva', /* ... */ }

// Per instance:
<PdfViewer locale="it" :messages="it" />

// Or app-wide via the plugin:
app.use(VuePdfz, { locale: 'it', messages: { it } })

Add an optional vue-i18n adapter

With an adapter to a host vue-i18n instance, keys resolve as ${prefix}${key} (the default prefix is vuePdfz.), with unresolved keys falling back to the built-in bundle.

import { useI18n } from 'vue-i18n'
import { createVueI18nAdapter } from 'vue-pdfz'

const i18n = useI18n()
app.use(VuePdfz, { i18nAdapter: createVueI18nAdapter(i18n) })

License

MIT