@warren-bank/save-website-to-pdf
v2.0.0
Published
Command-line utility for downloading an offline copy of a website and converting all HTML pages to a single PDF document.
Downloads
8
Readme
url2pdf
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
- it implements a "two-pass" strategy
Requirements:
Legal:
- copyright: Warren Bank
- license: GPL-2.0