Run M-x ps-print-buffer-with-faces
to send output to printer.
Run C-u M-x ps-print-buffer-with-faces
to send output to file (PS format).
Code: https://gitlab.com/atamariya/emacs/tree/dev
Screenshot: https://lifeofpenguin.blogspot.com/2021/06/basic-wysiwyg-printing-in-gnu-emacs.html