Groff ignores line breaks from my shell

I've been using groff to make ps files for printing with the -man flag. If I want to convert anything else such as a header file or just the output from ls -l or other program the line breaks are ignored, producing a mess. How can I get groff to see and respect the line breaks in use in the shell?

This produces an output but the tabs are messed up:

groff -mom hexd.c > out.ps

But this messes with both tabs and line breaks:

cat hexd.c | groff -mom > out.ps

What I would really like is something like this:

man -t gdb | open -f -a preview

Which opens a perfect post script version of the man page in preview on max os. BTW. man -t is equivalent to:

groff  -Tps  -mandoc -c

groff is a typesetting language, and it's expecting input in its language, not plain text. You may be looking for something like enscript or a2ps (ascii-to-postscript).