Skip to content

Command-line utility for downloading an offline copy of a website and converting all HTML pages to a single PDF document.

License

Notifications You must be signed in to change notification settings

warren-bank/save-website-to-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Command-line utility for downloading an offline copy of a website and converting all HTML pages to a single PDF document.

Installation:

npm install --global @warren-bank/save-website-to-pdf

Usage:

url2pdf <options>

options:
========
"-h"
"--help"
    Print a help message describing all command-line options.

"-v"
"--version"
    Display the version.

"-u" <URL>
"--url" <URL>
"--input-url" <URL>
    Specify the URL at which to begin recursively downloading a website.

"-d" <dirpath>
"--dir" <dirpath>
"--output-html-dir" <dirpath>
    Specifies the directory path where an offline copy of a website will be saved.

"-o" <filepath>
"--pdf" <filepath>
"--output-pdf-file" <filepath>
    Specifies the file path where the resulting .pdf file will be saved.

"--hooks" <filepath>
    Specifies the file path to a CommonJS module that can export various hooks to configure and modify behavior.

Hooks:

  • please refer to this complete example
    • it implements a "two-pass" strategy
      • 1st pass: extracts a table of contents to a new title page
      • 2nd pass: removes unwanted DOM elements (ex: header, footer, side navigation menu) before generating the final PDF document

Requirements:

Legal:

About

Command-line utility for downloading an offline copy of a website and converting all HTML pages to a single PDF document.

Resources

License

Stars

Watchers

Forks

Packages

No packages published