Here's
a link to a script I've used before to start me off on something similar to what you're doing. That is: converting word docs to plain text. For wrapping use one of the aforementioned modules, or try css - its probably easier that way.
Hope it helps. Good Luck.