cognitom / paper-css

Paper CSS for happy printing
https://www.npmjs.com/package/paper-css
MIT License
2.51k stars 342 forks source link

CLI tool: create, preview and export #4

Closed cognitom closed 7 years ago

cognitom commented 7 years ago

This PR adds a new feature to this library. The command below generates a PDF from the HTML file.

$ paper export examples/receipt.html

To create a HTML file from template:

$ paper create examples/receipt.html

To preview it:

$ paper examples/receipt.html

It's not a static conversion from HTML to PDF. It uses Electron for PDF generation, so you can use Riot or React or other JavaScript library in the HTML file.