Skip to content

Instantly share code, notes, and snippets.

@mingsai
Forked from davisford/markdown-to-pdf.txt
Created March 3, 2022 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mingsai/03b37ac8e9abcf71e8d5ff42636d150a to your computer and use it in GitHub Desktop.
Save mingsai/03b37ac8e9abcf71e8d5ff42636d150a to your computer and use it in GitHub Desktop.
Convert Markdown to PDF
$ brew install markdown htmldoc
$ markdown <file.md> | htmldoc --cont --headfootsize 8.0 --linkcolor blue --linkstyle plain --format pdf14 - > <file.pdf>
if (( $# != 2 ))
then
echo "Usage: md2pdf <input.md> <output.pdf>"
exit 1
fi
markdown $1 | htmldoc --cont --headfootsize 8.0 --linkcolor blue --linkstyle plain --format pdf14 - > $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment