1.0.0 • Published 9 months ago

pdf-my-url v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

pdf-my-url

A command-line utility to create PDFs from web pages using Puppeteer.

Installation

You can run this utility directly using npx:

npx pdf-my-url --url <webpage-url> --output <pdf-path>

Example

npx pdf-my-url --url https://www.google.com --output ./google.pdf

Features

  • Captures full-page screenshots
  • Automatically adjusts height to capture entire page content
  • Maintains high-quality output with proper scaling
  • Supports custom viewport width
  • Includes background colors and images in the PDF

Technical Details

The utility uses Puppeteer to launch a headless Chrome browser, navigate to the specified URL, and generate a PDF. It automatically:

  1. Sets the initial viewport
  2. Waits for the page to load completely
  3. Calculates the full height of the page
  4. Adjusts the viewport to match the content
  5. Generates a high-quality PDF with background elements
1.0.0

9 months ago