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

pi-pdf-watermark

v1.0.1

Published

Pi skill: Add customizable text watermarks to PDF files — center or tiled, with adjustable angle, font size, opacity, and color.

Downloads

204

Readme

pi-pdf-watermark

pi-package License: MIT

Pi Skill — Add customizable text watermarks to PDF files. Center or tiled, with adjustable angle, font size, opacity, and color.

✨ Features

  • Two watermark modes: Single centered stamp or full-page tiled repeat
  • Fully customizable: Text content, rotation angle, font size, opacity, color
  • Auto page-size detection: Handles A4, Letter, and any custom page dimensions
  • Cross-platform: Auto-detects Chinese fonts on macOS / Linux / Windows
  • Non-destructive: Outputs a new _水印版.pdf file, never overwrites the original

🚀 Install

# Via npm (recommended)
pi install npm:pi-pdf-watermark

# Or via GitHub
pi install git:github.com/ssdiwu/pi-pdf-watermark

📖 Usage

Once installed, just say:

"给这个 PDF 打水印"

The skill will ask you what text to use, then generate the watermarked PDF.

Examples

| What you say | What happens | |---|---| | "给 report.pdf 打水印" | Asks for text → defaults to tiled mode | | "给 report.pdf 打上「机密」水印" | Runs immediately, tiled | | "打一个居中的 30° 水印" | Uses center mode, 30° angle |

Command Line (standalone)

You can also run watermark.py directly without Pi:

# Install dependencies
pip3 install pypdf reportlab

# Basic usage (tiled by default)
python3 skills/pdf-watermark/references/watermark.py input.pdf "模力无限"

# Center mode
python3 skills/pdf-watermark/references/watermark.py input.pdf "CONFIDENTIAL" --mode center --angle 30 --opacity 0.2

# Custom font size & opacity
python3 skills/pdf-watermark/references/watermark.py input.pdf "DRAFT" --mode tile --font-size 36 --opacity 0.1

# Custom output path
python3 skills/pdf-watermark/references/watermark.py input.pdf "内部资料" -o output.pdf

CLI Options

| Option | Default | Description | |--------|---------|-------------| | input | (required) | Input PDF file path | | text | (required) | Watermark text | | --mode | tile | center (single) or tile (full-page) | | --angle | 45 | Rotation angle in degrees | | --font-size | 42 | Font size | | --opacity | 0.15 | Opacity (0–1) | | --output, -o | *_水印版.pdf | Output file path |

🔧 How It Works

User says "打水印"
       ↓
Skill asks: "请问要打什么水印文字?"
       ↓
User replies: "模力无限"
       ↓
Script runs with default tile mode → outputs *_水印版.pdf

Default behavior:

  • Mode: Tiled (满铺) — covers entire page at 45°
  • Only asks for watermark text, everything else uses sensible defaults
  • Switches to center mode only when user explicitly requests it

📦 Dependencies

  • pypdf — PDF reading/writing
  • reportlab — PDF generation (for watermark layer)

Both are installed automatically when running via Pi, or manually via:

pip3 install pypdf reportlab

🏗️ Package Structure

pi-pdf-watermark/
├── package.json              # Pi manifest + npm metadata
├── README.md                 # This file
├── LICENSE                   # MIT License
└── skills/
    └── pdf-watermark/
        ├── SKILL.md          # Skill definition (Pi reads this)
        └── references/
            └── watermark.py   # Watermark script (CLI-ready)

🤝 Contributing

PRs welcome! Feel free to open issues for feature requests or bugs.

📄 License

MIT © ssdiwu