Most printers (like the ubiquitous HP laserjets) allow you to straight up pipe text from the command line to the printer IP address or hostname like it was a text file, and it’ll spit it out on paper.
echo hello world > \\PRINTER
echo hello > tmp.txt
echo world >> tmp.txt
type tmp.txt > \\PRINTER
For you Uinx admins, type is cat.