Import from Odt
Unsolved
General and Desktop
-
Odt import file is very easy...
OOReader.h is my work, is a subset from Okular KDE ...
https://github.com/pehohlva/fop-miniscribus/blob/master/OO_Widged/oasis/OOReader.h
2017 the best way is now textutil from mac it convert doc rtf docx odt and many other format to txt or html to play in QTextedit ...void ZipDoc::handler_txtutils( const QString file ) { qDebug() << "### handler use-> " << __FUNCTION__; //// converter = /usr/bin/textutil if (converter.size() < 4) { text_s = QString("textutil -convert .. unable to read! or not mac osx."); } //// ram->LoadFile(file); //// const QByteArray base = ram->stream(); QTime myTimer; myTimer.start(); QProcess *process = new QProcess(NULL); process->setReadChannelMode(QProcess::MergedChannels); process->start(converter, QStringList() << "-convert" << "txt" << file << "-stdout", QIODevice::ReadOnly ); if (!process->waitForFinished()) { text_s = QString("Unable to read!."); } else { text_s = strip_tag(process->readAll()); } qDebug() << "### handler_txtutils time-> " << myTimer.elapsed(); }