To use SumatraPDF to convert a text file to a PDF from command-line:
SumatraPDF convert -o output.pdf input.txt
More info: