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

@zohocorporation/zpdf-cli

v1.0.1

Published

A powerful cross-platform CLI for PDF manipulation - compress, merge, split, protect, watermark, and more

Readme

@zohocorporation/zpdf-cli

A powerful cross-platform CLI for PDF manipulation built with Kotlin Multiplatform.

Installation

npm install -g @zohocorporation/zpdf-cli

Or install locally in your project:

npm install @zohocorporation/zpdf-cli

Features

  • Compress - Reduce PDF file size with configurable compression levels
  • Merge - Combine multiple PDFs into one
  • Split - Split a PDF into separate pages or ranges
  • Protect - Add password protection to PDFs
  • Unprotect - Remove password protection from PDFs
  • Flatten - Flatten annotations and form fields
  • Rotate - Rotate pages in a PDF
  • Extract - Extract specific pages from a PDF
  • Info - Display PDF metadata and information
  • Linearize - Optimize PDFs for web viewing (fast web view)
  • Watermark - Add text or image watermarks
  • Insert Blank - Insert blank pages
  • Insert Pages - Insert pages from another PDF
  • Delete Pages - Remove pages from a PDF
  • Swap Pages - Reorder pages in a PDF
  • Replace Page - Replace a page with content from another PDF
  • Copy - Create a copy of a PDF
  • Extract Attachments - Extract embedded files from a PDF
  • Overlay - Overlay one PDF on top of another

Usage

Basic Commands

# Show help and available commands
zpdf-cli --help

# Show help for a specific command
zpdf-cli compress --help

Compress PDF

# Basic compression with default settings
zpdf-cli compress -i input.pdf -o output.pdf

# Maximum compression for smallest file size
zpdf-cli compress -i input.pdf -o output.pdf -l maximum

# Available compression levels: none, low, medium (default), high, maximum

Merge PDFs

# Merge multiple PDFs
zpdf-cli merge -i file1.pdf -i file2.pdf -i file3.pdf -o merged.pdf

Split PDF

# Split into individual pages
zpdf-cli split -i input.pdf -o output_dir/

# Split specific page range
zpdf-cli split -i input.pdf -o output.pdf --start 1 --end 5

Protect PDF

# Add password protection
zpdf-cli protect -i input.pdf -o protected.pdf -p "userpassword"

# Add both user and owner passwords
zpdf-cli protect -i input.pdf -o protected.pdf -p "userpass" --owner-password "ownerpass"

Unprotect PDF

# Remove password protection (requires password)
zpdf-cli unprotect -i protected.pdf -o unprotected.pdf -p "password"

Rotate Pages

# Rotate all pages 90 degrees clockwise
zpdf-cli rotate -i input.pdf -o output.pdf -a 90

# Rotate specific pages
zpdf-cli rotate -i input.pdf -o output.pdf -a 90 --pages 1,3,5

Watermark

# Add text watermark
zpdf-cli watermark -i input.pdf -o output.pdf -t "CONFIDENTIAL"

# Add watermark with custom options
zpdf-cli watermark -i input.pdf -o output.pdf -t "DRAFT" --opacity 0.3 --font-size 48

Extract Pages

# Extract specific pages
zpdf-cli extract -i input.pdf -o output.pdf --pages 1,3,5-10

Get PDF Info

# Display PDF information
zpdf-cli info -i input.pdf

Flatten PDF

# Flatten annotations and form fields
zpdf-cli flatten -i input.pdf -o output.pdf

Linearize (Fast Web View)

# Optimize for web viewing
zpdf-cli linearize -i input.pdf -o output.pdf

Platform Support

| Platform | Architecture | Status | |----------|--------------|--------| | macOS | arm64 (Apple Silicon) | ✅ | | macOS | x64 (Intel) | ✅ | | Linux | x64 | ✅ | | Windows | x64 | ✅ |

Output Format

All commands return JSON output for easy integration with scripts and other tools:

{
  "success": true,
  "message": "PDF compressed successfully",
  "data": {
    "originalSize": 10485760,
    "compressedSize": 5242880,
    "compressionRatio": "50.0%"
  }
}

Exit Codes

  • 0 - Success
  • 1 - Error (check stderr for details)

License

MIT License - see LICENSE file for details.

Links