1. Aron Cox
  2. PowerBuilder
  3. Wednesday, 30 June 2021 08:58 AM UTC

I'm using the TX Text Control ActiveX 28.0 in PowerBuilder 2019 R3 to edit rich text and convert it to HTML for sending in an email.

It seems the only way to convert the data to HTML is to call SaveDocument with a file type of FileTypeHTML! and then read that file in again into a string so I can use it as needed.

There are two issues with this:

1. It's not all that efficent. I'm surprised there isn't a way to just extract the HTML version directly into a string. Am I missing something?

2. SaveDocument with a file type of FileTypeHTML! appears to only save in ANSI encoding . Is this not an issue? I note that when I paste in some text from a Word document I get non-breaking-spaces sometimes, and when I call SaveDocument and then reload it from file into a string these are converted to an  character. I suspect this has something to do with the encoding, but I'm not really sure. The only way I can think of to handle this, is to replace them all with &nbsp after reading from file into a string.

So if anyone has any thoughts on this, perhaps I am doing something wrong, perhaps I don't understand how rich text, HTML and Unicode work, perhaps this is a bug that needs to be reported?

Thanks!

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 30 June 2021 14:40 PM UTC
  2. PowerBuilder
  3. # 1

Hi Aron,

 

Please read this. I'm not sure if that bug has been resolved by now, but I guess not.
You have to be careful with the encoding utf16le! left me with some weird .tmp files every time.

https://www.appeon.com/standardsupport/search/view?id=5740

regards.

Comment
  1. Miguel Leeuwe
  2. Wednesday, 30 June 2021 18:57 PM UTC
Yw,

You might have to throw in some encoding too, but I cannot remember what is was for.

When I have some time I'll look into what exactly had to be encoded and get back to you.

  1. Helpful
  1. Miguel Leeuwe
  2. Friday, 2 July 2021 06:46 AM UTC
This is another bug you should be aware of: https://www.appeon.com/standardsupport/track/view?id=5954

When using v28.0 of the txt edit control and pasting an image copied from the "snipping" tool, you'll get an html with a link in it to a non-existing image. When using the "snip & sketch" tool, everything works fine.

You cannot use the V15.0 version, because that one screws up the html when you import it from disk using the InsertDocument() function. For that purpose, the v28.0 version does a better job.

Over the last years, there's not been a single version of any RTE which really works well and that's not very encouriging to use it.

I'm done with it.

regards
  1. Helpful
  1. Miguel Leeuwe
  2. Friday, 2 July 2021 06:49 AM UTC
The v15.0 version does not produce any link to a non-existing image file when you save as html, but ... also, depending on where you copied the image from (using Paint, snipping tool, etc.), the link might be not erroneous, but instead, completely missing.

My advice to everyone is to use an html editor like tiny mce.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 30 June 2021 14:10 PM UTC
  2. PowerBuilder
  3. # 2

Hi Aron;

  Please open a Support Ticket enhancement for both of these limitations. I can remember a "SaveAs() into a String variable" enhancement request back in the Sybase days but that was never addressed. The HTML options have not been updated since PB 11.x as far as I can remember and even that was limited more for web use in EAServer.

Regards ... Chris

Comment
  1. Aron Cox
  2. Wednesday, 30 June 2021 16:58 PM UTC
Thanks Chris, will do.
  1. Helpful
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.