I need to build a visual editor in C#. Given a piece of PHP and/or HTML code, the software will display them in the form of an editable webpage. At the same time it will display a dialog box from where the user should be able to edit options for the selected component. It is pretty like Adobe Dreamweaver's HTML editor but it needs to have the added functionality of handling PHP in it. (Dreamweaver parses HTML and just allows PHP segments while this program has to parse HTML as well as PHP).
I can build the dialog box stuff with functionality but my biggest problem is to create the WYSIWYG editor. Any suggestions/comments where I should start from?
Thanks in advance.
UPDATE
Basically it has to parse only a (very) small subset of PHP functions. Plus it has to parse some custom hard-coded functions. An example to parse out would be:
html here
...
...
<php echo $this->input(option1, option2, option3); ?>
...
more html here
This would show GUI to display a form field as it would show up in a browser.
Similarly there will be some other functions (less than 150) that need to be parsed out. Other built-in PHP functions don't need to be parsed except some string manipulation functions.
Take a look at TinyMCE. It's a javascript WYSIWYG editor, and supports plugins and customizations. There seems to be a php plugin availble as well on SourceForge.
If you want this in a WinForm or WPF app, you can embed it thru the WebBrowser control available.
[Edit: Rich Text Control]
You might can build on the code from this CodeProject. It extends the richtech box.
Also check out ModelText for winform which says it can parse HTML (created by https://stackoverflow.com/users/49942/chrisw). Not sure if it's extensible though.
Related
Background
I am working on a WPF windows application and I want add embedded PDF viewer with only basic functionalities including PDF view, text search and page navigation.
I tried embedded Internet Explorer and Adobe PDF Reader installed method (this way ) but this method is not suitable for our requirement as Adobe PDF Reader has too may external links which can not be allowed because of the security reasons of the application.
Therefore, I am trying to use moonpdf library. This library works fine with our requirements but the only problem is there is no text search functionality in this library. (I think it shows PDF as images)
Then, I have download moonpdf source code and realized that moonpdf is using libmupdf.dll wrapping to c#.
I can modify the moonpdf source code and mupdf source code for our requirement if needed.
My Question
Is there any text search functionalities in mupdf? if so how can I use it?
In the basic mupdf library, there are several functions for searching for text. These work by searching a page for a text string, in a few different variants, and returns the area for all hits of the given text. You need to iterate over the pages yourself (in order to do forward or reverse search).
fz_quad hits[1000];
count = fz_search_page(ctx, page, needle, hits, nelem(hits));
That said, I do not know how or even if "moonpdf" has wrapped these functions.
You can certainly extract the text from a document, the MuPDF library will do that. I believe it's up to you to apply your own search criteria after that. I'm afraid I'm not expert enough to answer the 'how to' part of it though. I imagine one of the mutool examples would be helpful here though. I'll see if I can get one of the developers to answer.
I am building mailing system, I want html editor for message body which convert html text to plain text and show in Editor plain text and while sending mail in again convert plain text to html text.
This is a control that is not delivered with stock Xamarin.Forms. So you need to either find a native counterpart, which I'm not sure there is, or roll your own. The nice people at Xam Consulting came up with the TEditor here.
Maybe that does what you want? Or in the least, it is a nice starting point to start working from.
I have a desktop application displaying text in a read only RichTextbox component. Some words in the text needs to be highlighted depending on a text analyze that was previously executed.
Now I need to create a web version of this application.
I know there's a couple of Rich Text Editors available but I would like to know if there's a library or a simple way to generate an properly tagged HTML string from a plain text and a list of word to highlight?
Here you have a free extension to RichTextbox that do what you want:
http://www.codeproject.com/Articles/12172/An-extended-RichTextBox-to-save-and-load-quot-HTML
You can use TinyMCE. This is free javascript based Reach Text Editor for the web.
TinyMCE Reach Text Editor
I have a bunch of HTML code that I need to display in a label/textbox in a windows app written in c#. It should be in such a way that the output shows the HTML formatted text, rather than the HTML code itself.
How can I do this?
Render your HTML in WebBrowser control. It has special events for document and you can iterate by tags like this Hope it will help you;)
Check out WebBrowser
There's a web browser control using IE's rendering engine to display HTML content. You might as well be able to do some simple parsing yourself and use a RTF control but that way you will be rather restricted.
If WebBrowser doesn't suit your needs you can check out these libraries with HTML label/control support
Telerik Controls for WinForms (Not Free)
http://www.telerik.com/products/winforms.aspx
GDI+ HTMLRenderer (Free, Open Source)
http://www.codeproject.com/KB/GDI-plus/HtmlRenderer.aspx?msg=2934040
The HTML Editor (a wrapper for MSHTML, the rendering portion of Internet Explorer) in read-only mode might be what you need.
In my current project I have the following situation: A multipage PDF gets rendered by some nasty software into a flash film. My job is to display that rendered flashfilm (will be rendered as file) in my current asp.net application.
I don't know what the rendered flashfilm will look like, but I assume all flash files behave the same? Or are there differences I should know about.
What options do I have to display that flashfilm? Does ASP.net support some built-in object oriented control that allows me to display flashfilm?
You can easily display any flash file by using a plethora of techniques. And it's not built-in, but there are a number of controls and other libraries built by the community to deal with displaying flash content in asp.net, such as Flash Control (http://flash-control.net/)
what you refer to as a flash film is a .swf file. the recommended way to embed .swf files is SWFOBject , a javascript library
http://code.google.com/p/swfobject/
now, i'm no asp specialist , but you may be able to fill the gap between javascript & asp.
hope it helps!