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

@rozie-ui/pdf-vue

v0.1.1

Published

Idiomatic Vue PDF viewer wrapping PDF.js — one Rozie source compiled to Vue.

Readme

@rozie-ui/pdf-vue

Idiomatic vue PdfViewer — a cross-framework PDF viewer compiled from one Rozie source wrapping PDF.js (pdfjs-dist). The current page is two-way bound via page (1-based), with selectable text, zoom and rotation. This package is generated; do not edit src/ by hand.

Install

npm i @rozie-ui/pdf-vue

Peer dependencies: the pdfjs-dist engine (^6) + vue. Install them alongside this package.

No separate engine-CSS import is needed — PdfViewer ships the selectable text-layer CSS itself. The PDF.js worker is auto-configured from a version-matched CDN, so the component works with zero config; override the workerSrc prop for offline / CSP / bundled-worker setups.

Usage

<script setup lang="ts">
import { ref } from 'vue';
import PdfViewer from '@rozie-ui/pdf-vue';

const page = ref(1);
</script>

<template>
  <PdfViewer
    src="/document.pdf"
    v-model:page="page"
    :scale="1.2"
    render-all-pages
    @load="(e) => console.log(e.numPages)"
  />
</template>

Props

| Name | Type | Default | Two-way (model) | Required | | --- | --- | --- | :---: | :---: | | src | unknown | undefined | | | | page | Number | 1 | ✓ | | | scale | Number | 1 | | | | rotation | Number | 0 | | | | workerSrc | String | "https://cdn.jsdelivr.net/npm/[email protected]/build/pdf.worker.min.mjs" | | | | standardFontDataUrl | String | "https://cdn.jsdelivr.net/npm/[email protected]/standard_fonts/" | | | | renderAllPages | Boolean | false | | | | textLayer | Boolean | true | | | | password | unknown | undefined | | | | options | Object | {} | | |

Events

| Event | Description | | --- | --- | | error | | | pagesrendered | | | passwordrequest | | | load | | | pagechange | |

Imperative handle

Beyond props, the component exposes imperative methods (declared once in the Rozie source via $expose). Grab a handle with the native ref mechanism and call them directly:

<script setup>
import { ref } from 'vue';
const viewer = ref();      // template ref
</script>

<template>
  <PdfViewer ref="viewer" ... />
  <button @click="viewer.nextPage()">Next</button>
</template>

| Method | Description | | --- | --- | | getDocument | Return the underlying pdfjs PDFDocumentProxy for direct API access (the engine escape hatch), or null before the document loads. | | getPageCount | Return the total number of pages in the loaded document, or 0 before it loads. | | goToPage | Navigate to a 1-based page (clamped to [1, pageCount]) — goToPage(n). | | nextPage | Advance to the next page (clamped at the last page). | | prevPage | Go back to the previous page (clamped at the first page). | | setScale | Set the zoom scale to an absolute value (1 = 100%) — setScale(s). | | zoomIn | Zoom in by one step (×1.25, capped at 10×). | | zoomOut | Zoom out by one step (÷1.25, floored at 0.1×). | | fitWidth | Fit the current page to the container width. | | fitPage | Fit the current page entirely within the container (width and height). | | rotateCW | Rotate the view 90° clockwise. | | rotateCCW | Rotate the view 90° counter-clockwise. | | download | Download the original PDF bytes — download(filename?) (defaults to document.pdf). Resolves true on success, false before the document loads. | | getMetadata | Resolve the document metadata (title, author, page labels, …) — pdfjs PDFDocumentProxy.getMetadata(). null before load. | | getOutline | Resolve the document outline (bookmark / table-of-contents tree) for a navigation sidebar — pdfjs getOutline(). null when absent or before load. |