There is no Qt QMagicDocument class with a set of saveAsArbitraryFormat() functions. QTextDocument can be exported as HTML or plain text, printed to PDF, or you could write a (non-trivial) function to output some arbitrary format from the object. C++ is a general purpose programming language. You are free to write any functionality you want, with or without using Qt and with or without using other third-party libraries.