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

@salonhub/capacitor-printer

v0.1.0

Published

Capacitor plugin for printing a PDF through the operating system's own print dialog

Readme

Capacitor Printer

Print a PDF through the operating system's own print dialog, on iOS and Android.

import CapacitorPrinter from '@salonhub/capacitor-printer';

const printer = new CapacitorPrinter();

const result = await printer.print({
    content: 'base64:JVBERi0xLjQK...',   /* a `data:` URL or bare base64 works too */
    name: 'Invoice 2026-0042',
    orientation: 'portrait'
});

if (result.outcome === 'completed') {
    /* the user sent it to a printer */
}

Why it exists

UIPrintInteractionController and PrintManager are both perfectly good APIs; what wrappers around them tend to get wrong is everything at the edges.

  • The promise resolves when the print UI is done, not when it opens. A cancelled print is reported as cancelled, not as a success. This is the whole point: a caller that fires an "it printed" callback the moment the dialog appears is lying to the user.
  • iPad gets a popover. present(from:in:animated:completionHandler:) anchored to the web view, which is what UIKit requires there — the iPhone variant does not work on iPad.
  • The document does not come back. The result carries an outcome, not a copy of the PDF that just crossed the bridge.
  • The Android temp file is deleted, in onFinish(), however the session ended.
  • The content type is checked, not sniffed. %PDF- at offset zero, rather than decoding a bitmap to find out what something is not.

API

print({ content, name, orientation })

content is a base64 PDF, with or without a base64: prefix or a data:application/pdf;base64, wrapper. name is the job name shown in the print UI and the spooler. orientation is 'portrait' (default) or 'landscape'.

Resolves { outcome: 'completed' | 'cancelled' }. Rejects with content_not_pdf, content_not_base64, no_content, no_print_service, cache_write_failed or print_failed.

On Android, completed means the job reached a print service: the framework only asks for the document once the user has confirmed, but it does not report what the printer did with it afterwards. On iOS the completion handler is authoritative.

getCapabilities()

Resolves { silent, default } — whether a job can print without showing the system dialog, and whether a remembered printer is available. Both are false on both platforms today.

Installation

npm install @salonhub/capacitor-printer
npx cap sync

The plugin registers as SheetPrinter — the device role it fills, which is not the same word as the package name.