Visual Studio displays XML on a special text box which
Properly indents the XML hierarchy;
Angle brackets are blue;
Elements are brown;
Attributes are red;
Strings are blue
Comments are green.
Where can I get a special "TextBox" like this, in C#, which is specialized to display XML to use in my code?
Note I don't need a whole library with a lot of functionalities - all I need is a TextBox that display XML in different colors and indents.
Many thanks!
I don't think you'll find a simple textbox as it is rather complex to handle syntax highlighting. A good open-source solution for this that I have used in past is SharpDevelop from ICSharpCode. Part of the full IDE is a textbox-like control that you can use in your own application without the full-blown IDE.
Another option if you just want to display the XML, without editing, is to display the XML using the web browser, embedded as a user control. Not very light-weight, but definitely possible.
Have a look at these links:
Syncfusion --this is not free. It provides support for many languages (including XML). The URL explains how to achieve that.
There is another post at stack overflow discussing the same thing.
Related
I need to create a C# or C++ (MFC) application that converts pdf files to txt. I need not only to convert, but remove headers, footers, some garbage characters on the left margin etc. Thus the application shold allow the user to set page margins to cut off what is not needed. I actually have already created such an application using xpdf, but it gives me some problems when I am trying to insert custom tags into the extracted text to preserve italics and bold. Maybe somebody could suggest something useful?
Thanks.
There are shareware and freeware utilities out there. Try fetching their source code, or perhaps use them the way they are.
A public version of the PDF specification can be found here: Adobe PDF Specification
PDF Shareware readers can be found: PDF Reader source code # SourceForge
Please look at Podofo. It's a LGPL-licensed library that has many powerful editing features. One of it's examples, txt2pdf IIRC, is a good start: it shows basic text-extraction; From there you can check if pre (in pdf engine) or post (in text) filtering suffices to your goals. I didn't get to use Pdf Hummus, but it's supposed to have these capabilities too, although it's less straightforward.
I'm trying to create a web script that will allow me to alter PDF templates that I have uploaded and re-output them. I have tried Zend already which allows me to write to a PDF but that means leaving the PDF blank in certain space which is to primitive for what I need. PDFFlip was not any better.
We need to implement functionality so we can remove content from the PDF as well as remove and replace. I have looked at CAM::PDF and changepagestring.pl but I'm not sure it's up to the job. I was hard pressed to find any real usage examples and Perl is not a language I have used before.
This is for a web project but I am flexible with the language we use, ideally PHP or ASP.NET C# would be great. Preferably not Java unless there is no other way.
I should also point out that I looked through the FoxitReader SDK without any luck. I never tried to implement it but I found no mention of find and replace like functionality.
You can tinker with PDF text but it is not straight-forward just to search and replace. The text is designed as an end-file format not for easy editing. I wrote a blog post explaining some of the issues at http://pdf.jpedal.org/java-pdf-blog/bid/12670/PDF-text
May be as workaround it's better to hold and fill in templates in some format that is more convenient for editing? E.g., you can keep your templates as Microsoft Word templates and then export them to PDF after filling. This thread may be useful on this way.
PDF file format isn't quite appropriate for editing.
Alternatively, you may prepare your templates as PDFs containing form fields. In this case filling of form fields is common and well-known task and there a lot of pdf components for this.
Is there any web content editor (like FCKEditor or WMD editor) that allows page layouts (images, tables etc.) like MS Word?
Not quite sure what exactly you ask for regarding page layouts, but telerik has a very feature rich html editor. It's a commercial product though.
Take a look at http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx
TinyMCE is the closest candidate to MSWord... Obviously, being a web interface, it cannot be EXACTLY like Word, but it has a number of word's features.
Both FCK and TinyMCE allow for tables and other layout elements (overall FCK having the better implementation of added elements), and both will allow images that you have a url for.
There is a plug-in for Tiny that allows image uploading, but it is heavy and I think proprietary.
Neither of the above is an inline editor, if that's what you want. Probably the best in that direction currently is TiddlyWiki.
I have been working on my own Mootools based implementation that will allow any webpage to be edited, and has image uploading et al built in. It is currently in Beta, but I can send you a link if that's your goal.
I'm in need of a solution to print or export (pdf/doc) from C#. I want to be able to design a template with place holders, bind an object (or xml) to this template, and get out a finished document.
I'm not really sure if this is a reporting solution or not.
I also don't want to have to roll my own printing / graphics code -- I'd like all display concerns handled in a template.
I initially think of this as something Crystal Reports can do (although I've never used CR), but I'm not sure if I'm abusing the system here -- I'm not really interested in binding ADO.NET datasets at the moment (screw datasets). Can Crystal deal with binding to objects?
Does SSRS or WPF play in this field too?
A subset of WPF-P is XPS which can be used to present your objects via databinding.
One of the best choices if you are already using WPF.
Google Keywords: XPS, FixedDocument, FlowDocument, WPF Printing
Might read through this thread:
http://groups.google.com/group/nhusers/browse_thread/thread/e2c2b8f834ae7ea8
Seems a lot of people like iTextSharp
http://itextsharp.sourceforge.net/
For Word docs, look into Word's Mail Merge feature and Word automation. I did this recently in a form letter printing project. Basically what I did was create a Word template file (file extension .dot) and in this template file I defined MergeFields in a standard form letter. My application queries a database for the records it needs to print and then for each record it returns it matches fields in the database with these merge fields and sends the result (the merged doc) to the printer.
It's working really well and if I had a link that gave a definitive explanation, I'd provide it (check back here, I'll see if I can't find the most useful ones). Hopefully I've provided enough keywords to let you find your own resources. I can go into more detail if you need.
I've never had to export PDF files but for a project I'm working on now I'll have to. For a free solution my research has lead to iTextSharp (like Will Shaver points out) but I've only done the initial investigations and I have found a few pay solutions I might end up resorting to.
Is there a tool to take a GUI designed in C# or other languages that can take the screen layout and export that to an XML file such that you end up with a template of the screen in XML terms? As well as take an XML file and display the resulting screen?
Have you investigated XAML in WPF? You mention C#, so it seems like this is directly in line with what you're asking about.
http://en.wikipedia.org/wiki/XAML
Another good jumping off point might be this:
http://en.wikipedia.org/wiki/List_of_user_interface_markup_languages
XAML and XUL are designed to work in precisely this way. QT and Glade also offer this facility. However, they do not (as far as I know) offer any facility to reverse engineer a GUI that was not created with the layout tooling.
To use this type of tool you have to go from the form designer, which will save the form as a descriptor file. The toolkit will then offer various means (the exact method varies with the toolkit) to load the descriptor file and render the screen from it or use the descriptor as input into a code generator.
There is java.beans.XMLEncoder/XMLDecoder. But if you want to do that sort of thing, I think you are misguided.