Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » RichText,QTF,RTF... » QTF to ODF (Open Document Format) converter (İnvestigating the possibility of writing a converter that can convert U++ qtf to odf files )
QTF to ODF (Open Document Format) converter [message #44128] Mon, 29 December 2014 14:48 Go to next message
Oblivion is currently offline  Oblivion
Messages: 1092
Registered: August 2007
Senior Contributor
Hello guys,

I use Open Document Format (odf) files daily, and I thought it might be a good idea to write a qtf to odf (and vice versa) converter.
I am well versed in ODF but not experienced with U++ RichText package's internals. I would like to ask you a question:

I don't want to duplicate code, and lose time, if it is unnecessary, so, is it possible to use RichText class and ParseQTF() directly for this purpose?
Or is there already a such qtf->odf converter package/funtction that I might have missed? All I need is a parser that can build a structure from a qtf text, so that I can convert it into a ODF file.

Regards,
Oblivion.


[Updated on: Mon, 29 December 2014 14:52]

Report message to a moderator

Re: QTF to ODF (Open Document Format) converter [message #44130 is a reply to message #44128] Tue, 30 December 2014 16:13 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hi Oblivion,

AFAIK, there is no QTF->ODF conversion code, but you can convert QTF to the following formats very easily:
  • PDF
  • HTML
  • RTF
Maybe QTF->RTF is what you need (although RTF->QTF does not exist) since QTF is quite simple and can't do all that ODF or even RTF does.

QTF->RTF has a few bugs with text and table colors but works quite well otherwise
Re: QTF to ODF (Open Document Format) converter [message #44131 is a reply to message #44130] Tue, 30 December 2014 21:01 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1092
Registered: August 2007
Senior Contributor
Quote:

Hi Oblivion,

AFAIK, there is no QTF->ODF conversion code, but you can convert QTF to the following formats very easily:

PDF
HTML
RTF

Maybe QTF->RTF is what you need (although RTF->QTF does not exist) since QTF is quite simple and can't do all that ODF or even RTF does.

QTF->RTF has a few bugs with text and table colors but works quite well otherwise


Hello Didier,

Thank you very much for your reply.
I guess I'll try RTF. I need something easily editable.
It also seems to me a good example on how to write an exporter/importer.

Regards,
Oblivion



Re: QTF to ODF (Open Document Format) converter [message #44132 is a reply to message #44131] Thu, 01 January 2015 13:37 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hello Oblivion,

To export to RTF I usually do the following:
RichText richTextObj = myRichTextGenerator;
SaveFile(fileName, EncodeRTF( richTextObj, CHARSET_UTF8));


To use QTF you have to convert to//from RichText, so use the following code:
String qtfString AsQTF( richTextObj );
richTextObj = ParseQTF(qtfString);


For HTML you have the
EncodeHtml()
function

To convert to PDF, I use Report class:
Report r;
r << qtfString
r.Perform();

==> this opens a dialog displaying the report. If the PdfDraw Package is included, then a 'PDF' button is present and you can export to PDF Smile

Hope it helps
Re: QTF to ODF (Open Document Format) converter [message #44136 is a reply to message #44130] Fri, 02 January 2015 19:40 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Didier wrote on Tue, 30 December 2014 16:13

(although RTF->QTF does not exist)


Well, it does:

RichText ParseRTF(const char *rtf);

Mirek
Re: QTF to ODF (Open Document Format) converter [message #44137 is a reply to message #44128] Fri, 02 January 2015 20:58 Go to previous message
Oblivion is currently offline  Oblivion
Messages: 1092
Registered: August 2007
Senior Contributor
Hello guys,

Thank you very much for your help. I tried RTF converter and it works just fine and is sufficient for my needs.

Regards,
Oblivion.


Previous Topic: how to get image from richtext?
Next Topic: Possible Bug with Printing under linux
Goto Forum:
  


Current Time: Thu Apr 25 17:54:20 CEST 2024

Total time taken to generate the page: 0.02984 seconds