lcnbala / electron-pdf

A command line tool to generate PDF from URL, HTML or Markdown files.

Home Page:https://github.com/fraserxu/electron-pdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

electron-pdf

NPM version build status Downloads js-standard-style

A command line tool to generate PDF from URL, HTML or Markdown files with electron.

I have a blog post explain why PDF Generation On The Web

electron-pdf

Install

npm install electron-pdf -g

Usage

Build PDF


  A command line tool to generate PDF from URL, HTML or Markdown files

  Options
    --help                     Show this help
    --version                  Current version of package
    -i | --input               String - The path to the HTML file or url
    -o | --output              String - The path of the output PDF
    -c | --css                 String - The path to custom CSS
    -b | --printBackground     Boolean - Whether to print CSS backgrounds.
                                 false - true
    -s | --printSelectionOnly  Boolean - Whether to print selection only
                                 false - default
    -l | --landscape           Boolean - true for landscape, false for portrait.
                                 false - default
    -m | --marginType          Integer - Specify the type of margins to use
                                 0 - default
                                 1 - none
                                 2 - minimum

  Usage
    $ electron-pdf <input> <output>
    $ electron-pdf <input> <output> -l

  Examples
    $ electron-pdf http://fraserxu.me ~/Desktop/fraserxu.pdf
    $ electron-pdf ./index.html ~/Desktop/index.pdf
    $ electron-pdf ./README.md ~/Desktop/README.pdf -l
    $ electron-pdf ./README.md ~/Desktop/README.pdf -l -c my-awesome-css.css

Inspired by electron-mocha

License

MIT

About

A command line tool to generate PDF from URL, HTML or Markdown files.

https://github.com/fraserxu/electron-pdf

License:MIT License


Languages

Language:JavaScript 100.0%