Every Mac runs CUPS, the printing system, and it has a front-end that lets you use its converters without printing anything. That front-end is cupsfilter, and I like it for the moment you need a quick PDF of a log or a config file to send to someone.
By default cupsfilter converts the input to PDF and writes it to standard output, so you redirect it into a file:
cupsfilter notes.txt > notes.pdf
It guesses the input type from the file name and contents. With -m you can ask for a different output type, and -t sets the document title. If you’re curious which filters CUPS chains together for a file, --list-filters prints them without converting anything:
cupsfilter --list-filters notes.txt
I’d reach for it when someone wants a document, not a text file, and opening an editor just to hit Export as PDF feels like too much. It also fits nicely in a script that collects a few logs and turns each one into a PDF.
My caveat: forget the > and your terminal fills up with raw PDF bytes, which is ugly but harmless. More important, the man page warns that filters run as your own user and security session, not the way the print system runs them, so the output can differ from what a real print job would give. The layout is plain too. For anything with styling, export from the app that made the document.
Further reading: cupsfilter man page (CUPS), cupsfilter for macOS (SS64)