基于Web的RTF编辑器解决方案
我已经研究如何做到这一点大约一周了,我想我正在寻找最好的方法来完成我想要完成的任务。
我正在尝试在我的网站中构建一个模块,该模块允许用户在所见即所得类型的编辑器中创建表单(字母),并且能够从列表中插入需要的变量。该网站是用 MVC 2 编写的,后端使用 C#。我已经开始在 Silverlight 中编写此模块,并且已经创建了一些功能,例如使用 WCF 服务从数据库加载变量列表,并通过选择它们将它们复制到 Silverlight 附带的 RichTextBox 中的选定文本。
我在使用 PHP 和 ckeditor 之前已经编写了这个模块,但我遇到的最大问题是在编写和编辑表单之后,它永远不会像在所见即所得编辑器中那样看起来完全一样。因此,我决定转向可以处理 RTF 或 DOC 类型文件的东西。我试图远离 PDF,因为将使用该应用程序的用户群将更习惯使用 Microsoft Word/Open Office,而不是使用 Adobe Acrobat。
我开始使用 Silverlight 4 内置的 RichTextBox,但我遇到的唯一问题是保存 UI 元素(例如图像或表格)的问题,而它的用途对我来说可能是一个“显示障碍”。我发现一些付费库似乎能够克服这个保存问题并添加更多功能,例如 Teleriks RichTextBox 或 DevExpress 的 RichTextBox,但我想在承诺购买之前我正在寻找此类模块的最佳解决方案Silverlight 控制套件。
我研究了 VectorLights RichTextBox 插件,并能够得到一些东西,但我不确定他们的保存是否不仅仅是 XAML 导出,而且我在用他们的库替换所选文本时遇到了问题。他们也没有任何文档,我试图避免将所有时间花在论坛上询问有关如何使用他们的库的问题。
所以我向您提出的问题是,一个应用程序需要创建 RTF 类型文档,保留与您在编辑器中看到的内容完全相同或非常接近的格式,并允许您通过选择变量来替换所选文本一个列表。您将如何编写以及该模块将使用哪些插件/输入格式。我最终必须从数据库中提取此表单,用数据库中的信息替换变量,并能够打印或通过电子邮件发送此表单。
我在下面添加了一个链接,其中包含我当前在 Silverlight 中编写的基础知识。
任何建议都会很棒。
I've been researching on how to do this for about a week now and I guess I am looking for the best way to go about doing what I am trying to accomplish.
I am trying to build a module in my website that will allow users to create forms (letters) in a wysiwyg type of editor with the ability to insert variables where needed from a list. The site is written in MVC 2 using C# for the backend. I have started writing this module in Silverlight and have some of the functionality already created such as loading a list of variables from a DB using a WCF service and copying them to the selected text in the RichTextBox that comes with Silverlight by selecting them.
I have written this module before using PHP and ckeditor but the biggest problem I had with this is after the form was written and edited it would never come out looking exactly like it did in the wysiwyg editor. Because of this I've decided to move toward something that can handle RTF or DOC type files. I am trying to stay away from PDF because the user base that will be using the application will be more use to using Microsoft Word/Open Office than using Adobe Acrobat.
I started using the built in RichTextBox with Silverlight 4 but the only problem I came across is the issue with saving UI elements such as images or tables and for what this is used for this can be a "show stopper" for me. I have found some paid libraries that seem to be able to overcome this save issue and add a lot more functionality such as Teleriks RichTextBox or DevExpress's RichTextBox but I guess I'm looking for the best solution for this type of module before I commit to purchasing a Silverlight Control suite.
I have looked into VectorLights RichTextBox plugin and was able to get something going but im not sure if their save does more than just a XAML export and I had issues replacing the selected text with their library. They also don't have any documentation and I'm trying to avoid spending all my time on a forum asking questions about how to use their library.
So my question to you is for an app that needs to create RTF type documents, retain the exact or very close to the exact format of what you see in the editor, and allow you to replace your selected text with a variable by selecting it out of a list. How would you go about writing and what plugins/input formats would you use for this module. I will have to eventually pull this form out of a database, replace variables with information out of the db, and have the ability to print or email this form.
I've added a link below that the basics of what I have currently written in Silverlight.
Any suggestions would be greatful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我做了更多研究,并决定尝试 Telerik 的评估版本。该控件允许我将文档保存为 PDF 或 DOCX,这正是我正在寻找的。我遇到的唯一问题是,当另存为 PDF 时,我无法将其作为 PDF 拉回到控件中,因此我将来必须研究 DOCX 到 PDF 的转换。但现在这完全按照我想要的方式工作。
I did a little bit more research and decided to try the evaluation version of Telerik. This control allows me to save documents as a PDF or DOCX which is what I was looking for. The only issue I ran into with this is when saving as a PDF I am unable to pull it back into the control as a PDF so I will have to look into DOCX to PDF conversion in the future. But for now this is working exactly how I was wanting it to.