adnan360 ba763d97e5 Change bash shebang line to env | 3 jaren geleden | |
---|---|---|
.. | ||
.gitignore | 4 jaren geleden | |
README.md | 4 jaren geleden | |
output.sample.html | 4 jaren geleden | |
output.sample.pdf | 4 jaren geleden | |
run.sh | 3 jaren geleden | |
run.sh-e | 3 jaren geleden | |
run.sh-e-e | 3 jaren geleden | |
style.css | 4 jaren geleden | |
test.md | 4 jaren geleden | |
topdf.js | 4 jaren geleden |
This example converts a Markdown file into HTML code and then to a PDF. This needs internet connection and unfortunately downloads its own copy of chromium inside node_modules
dir which is not perfect and not necessarily privacy friendly. But at the moment this the only solution that supports CSS3 columns.
npm install markdown-to-html --save
npm install html5-to-pdf --save
* If you get Error: html-pdf: Received the exit code '1'
on Debian:
export OPENSSL_CONF=/etc/ssl/
Just execute run.sh
on Linux:
./run.sh
You can also run:
node topdf.js
There are other options to the node
command:
--skip-pdf : does not create a PDF file
--skip-html : does not create an HTML file
Example:
# below just creates an HTML file
node topdf.js --skip-pdf