Last active
October 25, 2017 23:20
-
-
Save Mnkai/1a8171502d0e18b1af2159d285358c1e to your computer and use it in GitHub Desktop.
Printing markdown document to thermal printer by command line - depends on pandoc and wkhtmltopdf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/zsh | |
pandoc "$1" -o "/tmp/print_temp_out.html" --wrap=preserve -f markdown -t html -s | |
wkhtmltopdf --encoding utf-8 --margin-top 1mm --margin-bottom 7mm --margin-left 0mm --margin-right 0mm --page-height 210mm --page-width 47mm --grayscale "/tmp/print_temp_out.html" "/tmp/print_temp_out.pdf" | |
lp -d Zjiang-58 "/tmp/print_temp_out.pdf" | |
rm "/tmp/print_temp_out.pdf" | |
rm "/tmp/print_temp_out.html" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment