Unsolved Print ODT File
-
Hallo
I'm looking for stupid. Is there a way to print existing .ODT files from QT?
lf Chris -
Hi,
There's the Qt Print Support module.
-
Thx. I know this class, but how can i use it for .ODT files?
QTextDocument do not Support These type and QTextDocumentWriter only create such file.Lg chris
-
I think you should take a look at Okular, they have support for odt files.
-
-
Okular do chris but very bad. Styles are missing. I van convert to html this looks Good in Firefox but mit in QtextDocument
Is There a List wich html tags QTextDocument understand?
Or do you know a third party classLg chris
-
@ckvsoft
You did answer whether you are under Linux (Debian)? You can print --- which is what you said you want to do --- from there if so without trying to read it in. I don't think you will be able to "read" ODT file into Qt/QTextDocument
. -
@JonB
Currently ubuntu.
Open read and convert is not the Problem. But QTextDocument has limited html tags. So i can print but ist not formated as it schould be.So i am searching for a lib that can do this.
Install libre is Overkill for only print a odt.
Okular will also Show without styles.Lg chris
-
@ckvsoft
If you are saying you have HTML,QWebEnginePage
can print that. -
@JonB
Thx. I will try this today. Good idea
Lg chris -
@JonB
Incredible. QWebEnginePage show shows me everything wonderfully, but the print preview / printout is a blank pagelg Chris
-
Hi
That sounds like a bummer.
Could you try
https://doc.qt.io/qt-5/qtwebengine-webenginewidgets-html2pdf-example.htmland see if that give same result ?
-
-
Summarized:
I'll keep looking. I had no idea that it would be so cumbersome.
First I wrote a class that uses an OTT as a template to create the ODT file. At that time I did not know that it was cumbersome to display or print this file. Converted to HTML is not displayed correctly by QtextEdit. So we have to use QWebEngine. But now I noticed that the conversion to html is also not 100%. During this time I would have probably written my own template designer. I actually wanted to avoid that. I have no idea what I'm going to do now.lg Chris