1. Richard Carrier
  2. PowerBuilder
  3. Wednesday, 6 February 2019 00:28 AM UTC

Hello All, We constantly have issues converting RTF to HTML when sending out smtp emails via our PB app. You cannot send RTF thru SMTP.

The RTF control is nice but what we are really looking for is a nice HTML editor . I'm not aware of it being built in and saving a DW as HTML is no, not an option.

Any feedback is sincerely appreciated

 

Thanks

Richard

Who is viewing this page
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 10 March 2020 01:54 AM UTC
  2. PowerBuilder
  3. # 1

BTW: I did a feature request, 2 weeks before this Q&A was posted on the 24th of Jan '19. for Appeon to build in something like this.

https://www.appeon.com/standardsupport/track/view?id=2205

 

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 9 March 2020 17:10 PM UTC
  2. PowerBuilder
  3. # 2

If you don't like how the IE WebBrowser control's design mode works you can use use an 'online html control' which is basically just a small bit of HTML and a Javascript library. Then host that in the IE WebBrowser control.

It would be similar to the input box on this forum.

 

Comment
  1. Miguel Leeuwe
  2. Tuesday, 10 March 2020 01:48 AM UTC
The only concern I have, is whether the new browser control will be mature enough to allow for this.
  1. Helpful
  1. Roland Smith
  2. Tuesday, 10 March 2020 01:53 AM UTC
The new browser control is based on Chromium (the underpinnings of Chrome). It doesn't have a design mode like IE does. Any HTML/Javascript editors like TinyMCE should work.
  1. Helpful
  1. Miguel Leeuwe
  2. Tuesday, 10 March 2020 03:08 AM UTC
Thanks for clearing that up Roland.
  1. Helpful
There are no comments made yet.
David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Monday, 9 March 2020 15:39 PM UTC
  2. PowerBuilder
  3. # 3

Hi Richard

We have succesfully implemented an HTML email editor using the MS Web Browser in edit mode.

That might help you :)

We based it upon this from Roland:

https://www.topwizprogramming.com/freecode_webbrowser.html

 

Regards

David

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 6 March 2020 15:52 PM UTC
  2. PowerBuilder
  3. # 4

Hi Richard;

  The RTF Control's SaveDocument () command supports an HTML option. However, it does not work when using the internal TX Control but does work OK when using the internal TE Control. There is a support ticket open for this TX related issue in both the GA and MR2170 of PB2019.

Regards ... Chris

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 7 February 2019 01:48 AM UTC
  2. PowerBuilder
  3. # 5

There's maybe an easier way to not use SaveDocument() as html, but it demands you to have MS Word. The advantage is that it would also work for powerserver WEB:

https://www.codeproject.com/Tips/493346/RTF-TO-HTML

This can probably be coded using only OLE, straight from powerbuilder without the use of activeX and C# code.

The only thing that I have to figure out, is what it does with pasted images or images present in signatures. Does it treat them all in the same way? It's important to know how the images are being saved, since you have to add them as invisible attachments (meaning files temporarily on disk), when sending the email. So far that's the only and simplest way I've got it to work, also depending a lot on which email client the receiving site has.

The current richtext in powerbuilder does have a way to handle pasted images, but according to where you pasted it from, the rtf content is different. For example, I'm able to deal with images pasted from windows' snipping tool, but it all changes when pasting from for example "Paint" and it complicates my code too much. (What I try to do is to replace embedded images with a link to a file of the image).

Also, the "new" richtext control of powerbuilder seems to deal a lot better with pasted images, but since that's the only good thing about it, we cannot use it and would still have the problem of dealing differently with images, depending on how / from where they were pasted. I suspect I'll still have that problem, even when exporting using ms word :(

I'll give it a try once finished with the activex. I prefer to be independent of MS Office, though we already have a dependency for our clients on office, since we send the email using Outlook.

Comment
  1. Chris Pollach @Appeon
  2. Friday, 6 March 2020 15:47 PM UTC
Hi Miguel;

For PS Web & Mobile Apps, I send the RTF data stream to a Web Service that then returns me the HTML via the SaveDocument (HTML!) option. I have also used saving the RTF to a Table Blob and the have the WS operate on that and save the HTML is a secondary Blob column. Then all the PS Apps have to do is issue a SelectBlob for the converted HTML and then process that from there.

Note: In the WS, I convert all the "extended" ANSI characters to HTML escape sequences as well. For example:

À => À or => À

Food for thought.

Regards ... Chris
  1. Helpful
  1. Miguel Leeuwe
  2. Friday, 6 March 2020 16:16 PM UTC
Hi Chris,

Is that a self-made WS? I don't think we'll be allowed to setup a WS on IIS just for this. It would be more work for the guy who has to install everything. (yes, I know ...)

  1. Helpful
  1. Miguel Leeuwe
  2. Friday, 6 March 2020 16:27 PM UTC
Right now, for me the easiest way would be to just save in RTF format to a temporary file and then use an activex based upon https://www.codeproject.com/articles/27431/%2fArticles%2f27431%2fWriting-Your-Own-RTF-Converter ).

or, since all of our customers have (to have) office installed anyway: https://www.codeproject.com/Tips/493346/RTF-TO-HTML

Personally I don't like to depend on Word being installed, nor "interop". I've heard rumors that MS wants to push us to the MS Graph API, so who knows how long the interop solution will be around. (hopefully long enough for Appeon to finally fix the SaveDocument() function in html format :)

  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 7 February 2019 00:44 AM UTC
  2. PowerBuilder
  3. # 6

We also use a richtext control to send email. One of the problems is that it's difficult to deal with pasted images and logos in signatures.

Another problem is that the SaveDocument() on powerserver web does not allow HTML format, so right now I'm working on a .Net activeX which will do the export of the RTF to html, images included. I'm not sure yet if it will work, it all depends on how well it deals with copied text in richtext format by powerbuilder.

When I'm done with it, and if it really works, give me a week or 2, I'll upload the code and the activeX.

If you can't wait and want to have a go yourself, this is where I get the C# code from:

A great job done by Jani Giannoudis: 

https://www.codeproject.com/articles/27431/%2fArticles%2f27431%2fWriting-Your-Own-RTF-Converter )

It also allows you to convert from and to other formats.

All I'm doing is trying to rip out the "rtf to html" part and wrap it in COM so we can do OLE programming from powerbuilder.

At first I'm simply respecting the way it works with commandline parameters (which I'll simulate with a string passed in from powerbuilder), since they might be useful, but I'm sure it can be improved a thousand times when I'm done (by someone who actually knows C# well. I might trick a colleague I have to help me out with that part).

 

Regards,

Miguel

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 7 February 2019 00:26 AM UTC
  2. PowerBuilder
  3. # 7

Hi Richard,

I did a request for this 2 weeks ago: https://www.appeon.com/standardsupport/track/view?id=2205

It seems like Appeon is going to take it in consideration for a future release.

regards

Miguel

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 6 February 2019 18:03 PM UTC
  2. PowerBuilder
  3. # 8

This ActiveX control lists PowerBuilder as a supported language:

http://www.exontrol.com/exhtml.jsp

 

Comment
  1. Miguel Leeuwe
  2. Thursday, 7 February 2019 00:55 AM UTC
Nice one Roland, but ... a bit pricey I think.



Product Version Single (1 Developer) Team (>=3 Developers) Site (All Developers) Source (1 Developer)

eXSuite/COM 11.0.0.2 €1049 ($1320) €891 ($1121) €7372 ($9278) €2299 ($2894)

eXSuite/COM/64 11.0.0.2 €1049 ($1320) €891 ($1121) €7372 ($9278) €2299 ($2894)

eXSuite/COM/ANY 11.0.0.2 €1574 ($1980) €1338 ($1683) €11058 ($13918) €3449 ($4340)
  1. Helpful
  1. Roland Smith
  2. Thursday, 7 February 2019 01:23 AM UTC
The eXSuite is for all of their components. You can buy just the HTML Editor.



eXHTML/COM/ANY Single=€449 ($564) Team=€382 ($480)

  1. Helpful
There are no comments made yet.
Richard Carrier Accepted Answer Pending Moderation
  1. Wednesday, 6 February 2019 16:04 PM UTC
  2. PowerBuilder
  3. # 9

Hello All and thanks

 

We don't want to build our new app based on IE7. Also, the real problem with RTF is when its converted to HTML some special characters dont convert and you have to write special code that , character by character. 

Richard

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 6 February 2019 14:38 PM UTC
  2. PowerBuilder
  3. # 10

What Outlook does is send the message in Text or HTML (not sure which, possibly both) and attaches a file named winmail.dat containing the RichText version of the message. Then at the receiving end if they also use Outlook, it knows to display the RichText attached to the email. If the email client doesn't know about this convention, it will show the HTML or Text version.

 

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 6 February 2019 13:41 PM UTC
  2. PowerBuilder
  3. # 11

The Microsoft WebBrowser control can be placed into edit mode. Checkout my example:

http://www.topwizprogramming.com/freecode_webbrowser.html

The control defaults to IE-7 mode so to make it work in IE-11 mode there is a registry setting to add which is explained here:

https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/general-info/ee330730(v=vs.85)#browser-emulation

 

Comment
  1. David Peace (Powersoft)
  2. Monday, 9 March 2020 16:55 PM UTC
"The control defaults to IE-7 mode"

Isn't that a bit odd, it begs the question why? And I suppose why you would change it to IE11 mode?
  1. Helpful
  1. Roland Smith
  2. Monday, 9 March 2020 17:16 PM UTC
If what you are displaying in the control works in IE-7 mode then there would be no need to switch to IE-11.
  1. Helpful
There are no comments made yet.
Thierry Garrigues Accepted Answer Pending Moderation
  1. Wednesday, 6 February 2019 08:09 AM UTC
  2. PowerBuilder
  3. # 12

Hi

We also have the same needs

Best regards

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.