Using MimeEntity Conversion to convert HTML to Notes Rich Text

Anyone come across a problem when using a server agent to convert a block of HTML to Notes RichText using the Lotusscript MimeEntity class?

The conversion works fine except that tables automatically have a left offset in every column which throws the alignment out. Nothing I do with styles in the HTML to try and set the margin to 0 makes a difference.

Also found that the tag doesn’t get converted - had to parse them all to tags first.

Code snippet (answerString is a run of HTML retreived from ColdFusion using SoapConnect) …

Set stream = session.CreateStream

Call stream.WriteText(answerString)

Set body = newDoc.CreateMIMEEntity(“abc”)

Call body.SetContentFromText (stream, “text/html;”, ENC_NONE)

Call newDoc.Save(True, True)

Subject: Using MimeEntity Conversion to convert HTML to Notes Rich Text

Hi Peter,long time no hear.

You might look into a number of actions:

a) make sure your html is clean, jTidy or Tidy can do that for you

b) Transform the html to adjust all tags you might not need/want/don’t translate. This can be done with an XLST transformation (get it from formDomino.com)

c) The Mime comes with the default margin settings, however you html wouldn’t start at the margin but at 0. So you migh want to play with your forms left margin — or play with the RichText Styles

Hth

:wink: stw

Subject: RE: Using MimeEntity Conversion to convert HTML to Notes Rich Text

Hi Stephan,

Thanks for that. I’ll give them a try and see if it helps. Could be I’m barking up the wrong tree anyway. I have a rendertorichtext which takes the HTML formated item and renders it in the background into a notes richtext item. It now seems like the inset margins on the table columns occur at that point.

I’ll keep plugging away and see what comes up. Everything else now work fine - its just the tables which are holding me up on completing this assignment.

Cheers,

Peter

Subject: If you get stuck

If you just can’t get this working the way you want, you might want to try our Midas Rich Text LSX, which will also let you convert HTML to rich text, and which pays attention to many things the regular MIME to CD conversion does not. Again, it may or may not solve your problem, but the eval is free, so if you want to try, it is another option.