pandoc --from gfm -thtml input.md -o output.pdf
requirements are pandoc and wkhtmltopdf
pandoc
wkhtmltopdf
As alternative: md2pdf