Skip to content

aopal/headless-html-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

headless-html-pdf

Converts html files to pdf using Chrome headless mode.

Generated pdfs will be almost identical to manually printing to pdf from Chrome. htmlpdf should autodetect your Chrome installation, see below if it does not.

Installation

npm install headless-html-pdf

Dependencies

  • Google Chrome

Example

C:\Users\aopal\Documents\htmlpdf> htmlpdf "hello world.html"
[0119/184712.433:INFO:headless_shell.cc(568)] Written to file C:\Users\aopal\Documents\htmlpdf\hello world.pdf.

Flags

--destination=DIR                       Select directory to save pdfs to (default is current directory)
--set-executable=PATH_TO_CHROME         Manually set Chrome executable

Manually setting Chrome executable

htmlpdf --set-executable=/usr/bin/google-chrome

If htmlpdf doesn't autodetect your Chrome install or you want to use Chromium/Canary/etc. --set-executable=PATH_TO_CHROME will allow you to set the executable. --set-executable=default re-attemps auto-detection.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published