A CLI tool to build Root compatible PDF documents locally.
- Install wkhtmltopdf locally on your machine: download
- Install localPDF globally
npm install localpdf -g - Run it in whichever folder has your html file
localpdf myfile.html myoutputfile.pdf
Usage: localpdf [input_file] [output_file]
Arguments:
> input_file required Path to input HTML file
> output_file optional Path to output PDF file
Example: localpdf example.html example.pdf
- Install wkhtmltopdf locally on your machine: download
- Clone this repo by using the following command:
git clone git@github.com:RootBank/localpdf.git - Install the dependencies:
cd localpdfandnpm install
After you've installed this repo, you can convert files to PDF using the following command (make sure you've cd'd into the repo folder)
node index.js [input_file] [output_file]
- Create a HTML document e.g. index.html
- Open the localpdf folder under your Computer/Users/name e.g. rebeccalain/localpdf
- Move your HTML document to this folder.
- Back to Terminal/Command and making sure you are in the localpdf location (if you are not in this location, quit then and open the repo using your name e.g.
cd /Users/rebeccalain/localpdf - In the Terminal/Command paste
node index.js [input_file] [output_file]then edit to include your HTML file's name and the name you would like to save the pdf document e.g.node index.js index.html beccatest.pdf - On your desktop open the localpdf folder and you will now see a new pdf document. Open it to see the results from the html!
- Make sure your local npm setup is configured and that you have appropriate access
- Increase the minor or major version in the
package.json - After pushing changes to github; run
npm publish