rtf

How do I display a formatted (colour, style etc) log in Delphi?

I need to display a formatted log in Delphi 2009. The formatting does not have to implement all the features of say html, but a small subset e.g. colour, font style etc. Currently I am using a TRichEdit and my own proprietry tags e.g. this is blue. It is pretty convoluted to get this to work with a TRichEdit as there is no direct access...

iText - problem with line break character replaced by ?

I am working with code using iText. We are upgrading from iText 1.2 to iText 2.1.5. With the upgrade (no changes in the actual code), all the line break characters are being replaced with a question mark. This does not happen when the text automatically wraps in the document, only when the data being fed contains a line break. I am u...

Syntax colouring in WPF

Hi, Does anyone know if there's a free WPF syntax highlighting component? I'm currently using AvalonEdit, which is part of the new SharDevelop source. The trouble I'm having is that it doesn't appear to support binding for the text content. Does anyone know if this is possible or if there's any other similar controls that do support da...

rich text box savefile

While saving a .rtf file from rich text box the file orientation is not preserved, can anyone give me the solution for this? ...

How to convert Unicode characters to escape codes

So, I have a bunch of strings like this: {\b\cf12 よろてそ } . I'm thinking I could iterate over each character and replace any unicode (Edit: Anything where AscW(char) > 127 or < 0) with a unicode escape code (\u###). However, I'm not sure how to programmatically do so. Any suggestions? Clarification: I have a string like {\b\cf12 よろてそ...

How can you append a \line, not a \par to a System.Windows.Forms.RichTextBox

I am using the System.Windows.Forms.RichTextBox control in .NET 2.0 and am using c#. I have an array of strings that I would like to append to the RichTextBox, but I do not want to create new paragraphs in the RTF. I want the lines to be divided by \line commands, not \par commands in the RTF. (I want to simulate someone typing shift+en...

How to convert wiki markup to RTF?

I'd like to create some formatted text in a .net RichTextBox control. It seems like a lot of hassle to use the existing mechanism for formatting, e.g. selection etc. Some kind of markup would be much easier. I.e. just like markup works in this site. E.g. Some **bold** text. gives you "Some bold text". Does anyone: know if anything...

Can iTextSharp open an RTF document, manipulate it, and export the document to PDF?

Using iTextSharp (and c#/ASP.NET) is it possible to open an RTF document, manipulate it by replacing some text, insert an image (WMF or PNG), and the export that manipulated document to a PDF document that retains the formatting of the original RTF document? Essentially I'm hoping to create a simple mail merge solution with the template...

Add table of contents to RTF document

I am trying to generate a RTF document by hand and eventually will do it programtically. I plan to improve pyRTF so that it can generate "Table of contents", which I think it can't. I am not able to use RTF controls words (\tc, \tcf and \tcl.) to generate a TOC. http://msdn.microsoft.com/en-us/library/aa140283(office.10).aspx gives det...

Convert PDF to RTF in Java

Does anyone know of an easily available library or SDK which can be used to convert a PDF document to RTF in Java? ...

insert image to RTF file using PHP

How can I insert an image to an RTF file. Inside the RTF file there is a placeholder text like {photo}. I want to place the image at this position using php. ...

Retaining font size when loading/saving RTF in WPF

Consider the following RTF document {\rtf1\ansi\ansicpg1252\deff0\deflang1031{\fonttbl{\f0\fswiss\fprq2\fcharset0 Segoe UI;}{\f1\fswiss\fcharset0 Arial;}} {\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\f0\fs22 Sample Text\f1\fs20\par } It contains "Sample Text" in font Segoe UI 11 pt. Now when I load and then save the docume...

Character encoding for thai characters

I have a requirement to read a RTF file with thai characters and write it to a text file. I tried using TIS-620, MS874,ISO-8859-11,but thai characters are not displaying properly when i open the resulting output file in notepad or textpad. But it works well with Wordpad. Please guide me. Thanks and Regards, Ramya. Code that solved the ...

Reset RTF in RichTextBox?

I'm trying to "reset" the formatting in my RichTextBox (WinForms, not WPF). I was previously using richTextBox.Text = richTextBox.Text; However, that seems to have suddenly failed me. Now no matter what I set richTextBox.Text to, it retains some of the rtf formatting. I've tried richTextBox.Rtf = richTextBox.Text; However, that...

How to split an RTF file into lines?

I am trying to split an RTF file into lines (in my code) and I am not quite getting it right, mostly because I am not really grokking the entirety of the RTF format. It seems that lines can be split by \par or \pard or \par\pard or any number of fun combinations. I am looking for a piece of code that splits the file into lines in any l...

Output RTF special characters to Unicode

I have been looking around ocn Google and Stackoverflow but haven't found what I needed, but my question seems quite simple. Anyhow; What is the way to convert a string of RTF special characters such as "\'d3\'d6" (In this case Russian) to unicode chars or string using C#? ...

RichTextBox (.NET Winforms) problem (or alternative)

Hello! I have a problem with .Net's RichTextBox control. It seems that it doesn't support table cell formatting, which is funny because most of the time I create tables I want the cell contents to be right-aligned (numbers, currency). If I try to open a WordPad document in RichTextBox, it ignores (and actually removes) the commands fo...

RichTextBox Replacement Winforms .NET2.0+

I have been extending the RichTextBox control in VS2008 using C# (adding printer support and URL links). I have most of the functionality I need but the control is not that good. I do not know how to change the mouse cursor for image sizing handles. Bullets get out of wack with the size and colour. I need this for winforms not asp.net or...

Is there a Python module for converting RTF to plain text?

Ideally, I'd like a module or library that doesn't require superuser access to install; I have limited privileges in my working environment. ...

How to serve .RTFs

I support a web-application that displays reports from a database. Occassionally, a report will contain an attachment (which is typically an image/document which is stored in the database as well). We serve the attachment via a dynamic .htm resource which streams the attachment from the database, and populates the content-type based on ...