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 Html
Qtf to Html [message #1031] Wed, 15 February 2006 20:47 Go to next message
pivica is currently offline  pivica
Messages: 57
Registered: November 2005
Location: Belgrade, Serbia
Member
I have some qtf text and I wont to export it to html file. This is what I figure it for now:

String qtf = GenerateSomeQtf();

FileSel fsHtml;
fsHtml.Type(t_("HTML files"), "*.html")
	  .AllFilesType();

if(!fsHtml.ExecuteSaveAs(t_("Export to html")))
	return;

String fname = ~fsHtml + "." + "html";
FileOut out(fname);
if(!out) { return; }

Index<String> css; //??
const VectorMap<String, String> links;  //??
String basedir = fsHtml.GetActiveDir();

SaveStream(out, EncodeHtml(ParseQTF(qtf), css, links, basedir));


First, how to make css? Can I export them from qtf styles or make them manual.
What are links?
Re: Qtf to Html [message #1034 is a reply to message #1031] Wed, 15 February 2006 21:07 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, HTML export uses CSS mainly to reduce the size of output - they are generated automatically.

The idea of passing css is that those automagically generated CSS styles could be shared across the group of files. Before the first file, Index should be empty. Later convert it to HTML using "AsCss".

Links are "translations" of RichText links to HTML links. You can leave it empty if you do not want to have links translated.

BTW, instead of SaveStream, I would use SaveFile here Smile

Mirek
Re: Qtf to Html [message #1035 is a reply to message #1034] Wed, 15 February 2006 21:18 Go to previous messageGo to next message
pivica is currently offline  pivica
Messages: 57
Registered: November 2005
Location: Belgrade, Serbia
Member
Thanks for quick answer Mirek. Will try first thing in the morning.

> BTW, instead of SaveStream, I would use SaveFile here Smile

Why? Probably because SaveStream is for binary data and SaveFile for text one?
Re: Qtf to Html [message #1037 is a reply to message #1035] Wed, 15 February 2006 21:22 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
No, all files/streams in U++ are always binary.

However, it would save 1 line of code Smile

Instead of

FileOut out(filename);
SaveStream(out, data);

it would be simple

SaveFile(filename, data);

Smile

(OK, I admit that in case that file creation would fail, you would spend some CPU cycles to generate useless HTML, but I would live with it Smile

Mirek
Re: Qtf to Html [message #23021 is a reply to message #1031] Tue, 08 September 2009 10:47 Go to previous messageGo to next message
braddmark is currently offline  braddmark
Messages: 1
Registered: September 2009
Junior Member
Yes HTML export uses CSS mainly to reduce the size of output and are generated automatically..


_________________
Indianapolis web design
Re: Qtf to Html [message #23122 is a reply to message #23021] Thu, 17 September 2009 20:22 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

BTW, is there a way to generate HTML from QTF without explicit CSS, with internal style html definitions?
Re: Qtf to Html [message #23131 is a reply to message #23122] Thu, 17 September 2009 23:27 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Not at the moment.
Previous Topic: Problem with pasting images with transparency
Next Topic: How to construct RichText without using QTF?
Goto Forum:
  


Current Time: Sat Apr 20 16:23:23 CEST 2024

Total time taken to generate the page: 0.02582 seconds