Factored out styled document rendering and rtf rendering