Re: Printing of HTML emails still impossible.

On 2003.06.24 18:46, Albrecht Dreß wrote:
> Am 24.06.03 16:43 schrieb(en) Peter Bloomfield:
>> Agreed!  Perhaps we should revert to GtkHtml for handling html 
>> messages--it has a printing section in its api, and GtkHtml2 (which 
>> has been used in all Balsa-2.0.x versions) seems to have none.  Does 
>> anyone have any insights?
> IIRC, gtkhtml has been *very* unstable, killing balsa on a regular 
> basis through some types of adv/spam mails. This has been resolved 
> only with Gnome 2.2, so **please** don't move backwards!!
> I must admit that I doubt if html printing is (a) necessary and (b) 
> easy to do.
> My *personal* pov is that html printing is not necessary, as 99% of 
> the html-only mails I get are spam. Some people send multipart/
> alternative with a html and a plain part containing the same 
> information (read: text, not font/color/...). I know that there have 
> been extensive discussions about html mails here, and I don't want to 
> start that again. *I* think, if it should be implemented, it has a 
> *very* low priority.
> The second point is that afaict html rendering/printing may be 
> difficult to implement in the current framework. The only quick and 
> easy solution would be an api which returns pixmaps or ps structures 
> for a given area (remember that the html part may start somewhere on 
> balsa's printout, due to headers/other parts). Implementing that 
> within balsa itself would be a *huge* task and incomplete almost 
> forever; even mozilla can not print everything correctly...
> Just my ¤ 0.01...
> Cheers, Albrecht.

Here's an entirely un-thought out and off the wall suggestion.

Use the HTML parser in libxml2 to build the DOM tree, and implement 
something that prints a very limited subset of the markup in the tree, 
say handling only headings, paragraphs and bold, italic and underline.  
Essentially this would give a result slightly enhanced over plain text. 
I doubt that it's even necessary to handle images.  Since we don't need 
to print spam and genuine HTML mails have mostly useful text, I'm 
guessing that this will suffice for the majority of messages.

Furthermore, since where libxml2 goes libxslt usually isn't far behind, 
it would be trivial to apply an XSL-T stylesheet to the DOM tree before 
printing it, which would permit cleaning up tricky messages.  The XSL-T 
could of course be hacked ad-nauseum without having to touch balsa's 

Right, I'll go back to sleep now :)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]