To convert a text file into a PDF you can use enscript
to convert it into a PostScript and pipe that through ps2pdf.
To get a txt2pdf
command, add the following to your bash functions (in e.g. ~/.bash_function):
txt2pdf() {
read -p "This will overwrite ${@%.*}.pdf. Are you sure? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
enscript "$@" --output=- | ps2pdf - > "${@%.*}".pdf
fi
}