rtf

How to create and save a .rtf, .doc, .docx in Objective-C for iOS

可紊 提交于 2019-11-28 10:29:57
I am looking to create and save either a rtf, doc or docx file on an iPad (iOS). The scenario is that we'd like to assist a user in creating content on their iPad and then let them email this as an editable document cross-platform (OS X, WIN). I am open to other solutions besides the rtf, doc or docx file format. Thanks, James RTF is going to be the easiest, because it's a plain text format. It's kind of like HTML, but without closing tags. Here is a class for writing an RTF, but it requires a lot of dependencies from elsewhere in the framework. DOCX would be rather difficult. It's actually a

How to convert FlowDocument to rtf

落爺英雄遲暮 提交于 2019-11-28 08:38:05
I have used a WPF RichTextBox to save a flowdocument from it as byte[] in database. Now i need to retrieve this data and display in a report RichTextBox as an rtf. when i try to convert the byte[] using TextRange or in XAMLReader i get a FlowDocument back but how do i convert it to rtf string as the report RichTextBox only takes rtf. Thanks Arvind You should not persist the FlowDocument directly as it should be considered the runtime representation of the document, not the actual document content. Instead, use the TextRange class to Save and Load to various formats including Rtf . A quick

Output RTF special characters to Unicode

偶尔善良 提交于 2019-11-28 01:50:35
问题 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#? 回答1: any of the following should help: Rich Text Format (RTF) Specification, version 1.6, Special Characters. according to this, \'d3\'d6 are hexadecimal value[s], based on the specified character set . so you could write

WinRt: Binding a RTF String to a RichEditBox

蹲街弑〆低调 提交于 2019-11-27 23:02:26
问题 Searched a long time to bind some RTF text to an RichEditBox Control on Windows Store Applications. Even it should function in TwoMay Binding Mode. ... 回答1: ... finally I found the following solution. I created a inherited control from the original RichEditBox control with a DependencyProperty RtfText. public class RichEditBoxExtended : RichEditBox { public static readonly DependencyProperty RtfTextProperty = DependencyProperty.Register( "RtfText", typeof (string), typeof (RichEditBoxExtended

Getting RTF data out of Mac OS X pasteboard (clipboard)

纵饮孤独 提交于 2019-11-27 14:44:11
问题 According to the man page for pbpaste , -Prefer {txt | rtf | ps} tells pbpaste what type of data to look for in the pasteboard first. As stated above, pbpaste normally looks first for plain text data; however, by specifying -Prefer ps you can tell pbpaste to look first for Encapsulated PostScript. If you spec- ify -Prefer rtf, pbpaste looks first for Rich Text format. In any case, pbpaste looks for the other formats if the preferred one is not found. The txt option replaces the deprecated

Why isn't the richtextbox displaying this table properly?

て烟熏妆下的殇ゞ 提交于 2019-11-27 14:02:18
问题 Apparently, the RichTextBox provided by Microsoft doesn't fully support the RTF specs. For some reason, it won't permit multi-lined rows, and destroys formatting instead. Forexample, here is the RTF code to generate a table: \par \trowd\trgaph108\trleft36\trqc\trrh280\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3 \cellx2000\cellx4000\cellx6000\cellx6500\cellx8500\cellx9000\cellx11000 \pard\intbl Length of Time until Replayment\cell\cell Flate Fee Percentage\cell\cell Broker and Application Fees

Using TRichEdit at runtime without defining a parent

淺唱寂寞╮ 提交于 2019-11-27 12:09:36
I need to use a TRichEdit at runtime to perform the rtf to text conversion as discussed here . I succeded in doing this but I had to set a dummy form as parent if not I cannot populate the TRichedit.Lines. (Error: parent is missing). I paste my funciton below, can anyone suggest a way to avoid to define a parent? Can you also comment on this and tell me if you find a more performant idea? Note: I need a string, not TStrings as output, this is why it has been designed like this. function RtfToText(const RTF: string;ReplaceLineFeedWithSpace: Boolean): string; var RTFConverter: TRichEdit;

Displaying a MS Word File in View(say TextView) in Android

假如想象 提交于 2019-11-27 10:31:53
问题 I want to display a .docx file in a View in Android. The file has mathematical symbols and also images in between the text. I want to display many such files and flip through them via swipe gesture. I have successfully done the same for .txt files. And can now very easily go to the next page on swipe. The code for .txt file is as follows: public String readTxt(String fileName) { try { InputStream is; is = context.getAssets().open(fileName + ".txt"); ByteArrayOutputStream byteArrayOutputStream

Using Tables in RTF

五迷三道 提交于 2019-11-27 09:04:17
I need to create a table in an RTF file. However I am not familiar with RΤF. Here is an example of a text file that these RTF files are supposed to replace: GENERAL JOURNAL Page 1 Date Description Post Ref Debit Credit ------------------------------------------------------------------------------ 2011 Dec 1 Utilities Expense 512 250.00 Cash 111 250.00 Paid electric bill for November, Check No. 1234 2 Cash 111 35.00 Accounts Receivable / Customer Name 115/√ 30.00 Interest Income 412 5.00 Receipt of payment on account from Customer, Check No. 5678 . . . The table is supposed to have borders, but

Reset RTF in RichTextBox?

感情迁移 提交于 2019-11-27 08:42:34
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 complains about an incorrect format. There's gotta be a better way to do this. (Of course, selecting the entire thing, then resetting the back color, fore color, and font works, but that results in a flicker as the entire thing is selected then deselected, plus it's