Skip to content

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

License

Notifications You must be signed in to change notification settings

GXiang314/url2pdf

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

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •