I am converting emails to PDF. Sometimes it comes in as text, and i need to convert to HTML first.
So to avoid losing the formatting,I surround it with <pre></pre>.
But that means if they didn’t have word-wrap on when they wrote the email, it will be one long line, causing the font to scale down, sometimes to size 1 or 2.
I've tried a lot of HTML that adds wordwrapping as a style, and it works for web browsers, but it either gets cut off or the text shrinks. It seems to be an Adobe bug, because no amount of CSS wizardry fixes it.
I was running into the same issue with displaying text and HTML based emails in the same rich text field. I could not get a CSS/HTML solution, but replacing all newline characters worked to preserve the spacing.
Here is the function I use to properly process and display HTML in a rich text field.