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

cap-printer

v1.2.0

Published

Capacitor plugin for printing pdf documents local and remote

Readme

Capacitor plugin for printing PDF documents - both local and remote.

📦 Installation

npm install cap-printer
npx cap sync

🔌 API

Plugin interface for CapPrinter.

print(...)

print(options: PrintRequest) => Promise<void>

Print a PDF document from a remote URL or local file path.

Either url or localPath must be provided.

| Param | Type | | ------------- | ----------------------------------------------------- | | options | PrintRequest |


isAvailable()

isAvailable() => Promise<{ available: boolean; }>

Returns whether the plugin is available on the current platform.

Returns: Promise<{ available: boolean; }>


Interfaces

PrintRequest

Parameters for a print request.

| Prop | Type | Description | | --------------- | ----------------------------------------------------- | ----------------------------------------------------------------- | | url | string | Remote PDF file URL. Optional if localPath is provided. | | localPath | string | Local file path to a PDF document. Optional if url is provided. | | options | PrintOptions | Optional native print configuration. |

PrintOptions

Optional print configuration for native print dialogs.

| Prop | Type | Description | | ----------------- | ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | outputType | 'general' | 'photo' | 'grayscale' | Defines the output quality or color mode. - general: Default system quality - photo: High-quality color/photo print - grayscale: Black & white / grayscale | | orientation | 'portrait' | 'landscape' | Sets the page orientation. - portrait: Standard vertical layout - landscape: Horizontal layout | | duplex | boolean | Enables duplex printing if the printer supports it. |

🧪 Usage

Basic usage

import { CapPrinter } from 'cap-printer';

await CapPrinter.print({
  url: 'https://example.com/your.pdf',
  options: {
    outputType: 'photo',
    orientation: 'landscape',
    duplex: true,
  },
});

For local files

import { CapPrinter } from 'cap-printer';

await CapPrinter.print({
  localPath: '/path/to/your/file.pdf',
});

Plugin availability check (recommended for Web support)

import { CapPrinter } from 'cap-printer';

const { available } = await CapPrinter.isAvailable();

if (!available) {
  console.warn('CapPrinter is not available on this platform.');
  return;
}

await CapPrinter.print({ url: 'https://example.com/your.pdf' });

ℹ️ On Web, isAvailable() always returns false.

📝 Changelog

For a detailed list of changes and version history, check out the CHANGELOG.md.

🤝 Contributing

Contributions are welcome!
If you'd like to improve the plugin, report an issue, or suggest a feature, feel free to open a pull request or create an issue.

🪪 License

This plugin is licensed under the MIT License.