Skip to content

Repository files navigation

url2pdf

A lightweight CLI tool to convert web pages to PDF files with batch processing support.

Features

  • 🚀 Simple one-command conversion for single URLs
  • 📦 Batch processing from JSON files
  • 🎯 Automatic or custom PDF naming
  • ⚡ Fast Puppeteer-based rendering

Quick Start

# Install dependencies
pnpm install

# Build the CLI
pnpm build

# Convert a single URL
node dist/cli.js --url "https://example.com" --title "example"

# Batch convert from JSON file
node dist/cli.js --batch urls.json

Documentation

Basic Commands

# Development with hot reload
pnpm dev

# Build for production
pnpm build

# Run tests
pnpm test

# Execute built CLI
pnpm start

Batch JSON Format

Create a JSON array with URL objects:

[
  { "url": "https://example.com", "title": "example" },
  { "url": "https://github.com" }
]

Output

PDFs are saved to outputs/<timestamp>/ with automatic title generation from page titles when not specified.

License

MIT

About

A lightweight CLI tool to convert web pages to PDF files with batch processing support.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages