Thanks for your reply. But as I want do this pre-processing on the fly, using "setPlainText(text)" seems to be slow on large documents.