Delphi 的 WYSIWYG HTML 编辑器组件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2146116/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 02:00:04  来源:igfitidea点击:

WYSIWYG HTML Editor Component for Delphi

htmldelphieditorwysiwyg

提问by Pieter van Wyk

I need to send Email from my Delphi application. What I need is a WYSIWYG editor that I can use in the application to create the body of the email in HTML. Any ideas? Thanks, Pieter.

我需要从我的 Delphi 应用程序发送电子邮件。我需要的是一个 WYSIWYG 编辑器,我可以在应用程序中使用它来创建 HTML 格式的电子邮件正文。有任何想法吗?谢谢,彼得。

采纳答案by Nick Brooks

We've used TRichViewjust recently to do HTML email functionality and found it quite adequate. We did evaluate WpToolsand it does do exactly what we wanted however for our needs it was just too expensive especially when we always try and purchase site licences.

我们最近刚刚使用TRichView来实现 HTML 电子邮件功能,发现它已经足够了。我们确实评估了WpTools,它确实可以满足我们的需求,但是对于我们的需求,它太贵了,尤其是当我们总是尝试购买站点许可证时。

One thing we did find with WpTools is that it did implement a visual component or set of visual components that you could drop onto a form that implement the whole WYSIWYG UI (e.g. toolbars and such). It took a bit longer with TRichView to achieve the same thing.

我们在 WpTools 中发现的一件事是,它确实实现了一个可视化组件或一组可视化组件,您可以将它们放到实现整个​​ WYSIWYG UI(例如工具栏等)的表单上。使用 TRichView 需要更长的时间才能实现相同的目标。

Regarding conversion from/to html - TRichView can export html natively, however requires third-party libraries to import html which unfortunately (for us) are not commercially backed (i.e. community driven). So we've resorted to storing all content in RichText natively and only when sending the email do we convert it to html. WpTools has the ability to import/export to html natively.

关于从/到 html 的转换 - TRichView 可以本地导出 html,但是需要第三方库来导入 html,不幸的是(对我们来说)没有商业支持(即社区驱动)。因此,我们已将所有内容本地存储在 RichText 中,并且仅在发送电子邮件时才将其转换为 html。WpTools 能够本地导入/导出到 html。

回答by Edelcom

I have been looking for this as well for several years now.

我也一直在寻找这个好几年了。

  • The best solution I found, until now, is WpTools from WpCubed. It's not an exact Html editor, but an advanced word processing component which offers a copy mode to and from html. I am currently working on using this component in my Sitestepper web creation software (in the StepEdit html-editor to offer wysiwyg possibility). I think that certainly for email editing this could be used (although maybe a bit pricy for what you are looking for). I know the author is working an a better exchange to and from html.

    But to be honest, I don't think you will find anything if you need a Delphi component.

  • I used to use HtmlEdit from Purposesoft, but I think this product has got his limitations and it's not fully supported anymore. But maybe for your purpose it's ok.

  • 到目前为止,我发现的最佳解决方案是来自 WpCubed 的 WpTools。它不是一个精确的 Html 编辑器,而是一个高级文字处理组件,它提供了与 html 之间的复制模式。我目前正在我的 Sitestepper 网络创建软件中使用这个组件(在 StepEdit html 编辑器中提供所见即所得的可能性)。我认为这当然可以用于电子邮件编辑(尽管对于您正在寻找的内容来说可能有点贵)。我知道作者正在与 html 进行更好的交流。

    但说实话,如果你需要一个 Delphi 组件,我认为你不会找到任何东西。

  • 我曾经使用过来自 Purposesoft 的 HtmlEdit,但我认为该产品有其局限性,并且不再完全受支持。但也许为了你的目的,没关系。

回答by r4w8173

I've used EmbeddedWB from bsalsa. Basically it is the same as Delphi's TWebBrowser, but you have access to more features of the IE automation object. In the browser I loaded an HTML which looks like:

我使用过 bsalsa 的 EmbeddedWB。基本上它与 Delphi 的 TWebBrowser 相同,但您可以访问 IE 自动化对象的更多功能。在浏览器中,我加载了一个 HTML,它看起来像:

<html>
<head>
<title>Edit description</title>    
</head>

<body contenteditable="true">
</body>
</html>

Marking an element by IE specific attribute "contenteditable", the IE implementation let's you edit the element's inner HTML in a WYSIWYG manner. You can get the content by automation calls (check bsalsa.com to see how to read the edited content). If you get the basics it is pretty simple to create a full blown HTML editor.

通过 IE 特定属性“contenteditable”标记元素,IE 实现让您以所见即所得的方式编辑元素的内部 HTML。您可以通过自动调用获取内容(查看 bsalsa.com 以了解如何阅读编辑后的内容)。如果您掌握了基础知识,那么创建一个完整的 HTML 编辑器非常简单。

Good luck!

祝你好运!

回答by Darren

My answer using Bsalsa Web Browser Components - very easy complete HTML editor/viewer. delphi-how-do-i-make-a-basic-wysiwyg-html-editor-using-delphi

我的回答使用 Bsalsa Web 浏览器组件 - 非常简单的完整 HTML 编辑器/查看器。 delphi-how-do-i-make-a-basic-wysiwyg-html-editor-using-delphi

回答by Runner

If using IE COM based components is not a problem then you can use this free product

如果使用基于 IE COM 的组件没有问题,那么您可以使用这个免费产品

http://bsalsa.com/product.html

http://bsalsa.com/product.html

I have just recently needed a free HTML WYSIWYG editor and I thinks this is the only thing out there. For me it works fine, but I don't need complicated elements. They can be done, but will a little more work.

我最近刚需要一个免费的 HTML WYSIWYG 编辑器,我认为这是唯一的东西。对我来说它工作正常,但我不需要复杂的元素。它们可以完成,但需要做更多的工作。