Skip to content

aautcq/pdfize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDFize

CLI tool to convert HTML files to PDF.

Usage

npx pdfize -s index.html -o my-file.pdf

Disable PDF shrinking (enabled by default):

npx pdfize -s index.html -o my-file.pdf --shrink=false

Exclude Parts From PDF

You can remove specific sections from the generated PDF without editing the source file.

  1. Use built-in conventions in your HTML:
  • .no-pdf
  • [data-pdf-exclude="true"]
  1. Or pass custom CSS selectors with --exclude (repeatable):
npx pdfize -s index.html -o my-file.pdf \
	--exclude ".sidebar" \
	--exclude "#debug-panel"
  1. Disable built-in exclusions when needed:
npx pdfize -s index.html -o my-file.pdf --disableDefaultExclusions

About

PDF files are generated using Headless Chrome through Puppeteer, then shrunk using Alfred Klomp's shrinkpdf script.

About

CLI tool to convert HTML files to PDF

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors