rtf

Update code to swift 2 [closed]

江枫思渺然 提交于 2019-12-13 11:21:21
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . How do i update following code to swift 2 i am new if let rtf = NSBundle.mainBundle().URLForResource("rtfdoc", withExtension: "rtf", subdirectory: nil, localization: nil) { let attributedString = NSAttributedString(fileURL: rtf, options: [NSDocumentTypeDocumentAttribute:NSRTFTextDocumentType], documentAttributes

Convert RTF to PDF format

≯℡__Kan透↙ 提交于 2019-12-13 10:43:13
问题 Any ideas how to convert RTF to Text format and to keep both style and fonts? NOTE: I want to avoid using System.Windows.Forms Update I have something like this in RTF <P style="TEXT-ALIGN: center; MARGIN: 0in 0in 0pt" class=MsoNormal align=center><FONT face=Calibri><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 14pt"><STRONG>Questions and Answers<BR style="mso-special-character: line-break"></STRONG><BR style="mso-specialcharacter: line-break"></SPAN><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE:

How to load rtf using url instead of local

别说谁变了你拦得住时间么 提交于 2019-12-13 07:28:03
问题 I have code to load local rtf files in textview but how to do i make it works for files located online Since it does not works when i use url Here is url - http://howtotechworld.com/rtfdoc.rtf Here is code if let rtf = NSBundle.mainBundle().URLForResource("http://howtotechworld.com/rtfdoc", withExtension: "rtf", subdirectory: nil, localization: nil) { do { let attributedString = try NSAttributedString(fileURL: rtf, options: [NSDocumentTypeDocumentAttribute:NSRTFTextDocumentType],

RichEditBox: Using CTRL+I to set italic text deletes the text

牧云@^-^@ 提交于 2019-12-13 03:43:56
问题 I have the following code to bold and italicise text in a RichEditBox: private async void Page_KeyDown(object sender, KeyRoutedEventArgs e) { var state = Window.Current.CoreWindow.GetKeyState(Windows.System.VirtualKey.Control); if ((state & CoreVirtualKeyStates.Down) == CoreVirtualKeyStates.Down) { switch (e.Key) { case Windows.System.VirtualKey.B: await BoldText(); break; case Windows.System.VirtualKey.I: await ItaliciseText(); break; } } } private async Task BoldText() { ITextSelection

InnoSetup, How to load a custom text into RTFText

淺唱寂寞╮ 提交于 2019-12-12 23:07:49
问题 I'm trying to store the text of InfoBefore textfile into a variable and then load it into the RTFEditor with a custom font color and backcolor. When I try to load the text from the variable it says "Write-only property" I need a explicit example of how to do this two things together (Store the text in the var, load the text in the RTF with a custom color and backcolor) without complicating the things too much because I don't know Pascal. This is the code: const FontColor: AnsiString = 'cf0';

How to read .rtf File from URL in iPhone App

你离开我真会死。 提交于 2019-12-12 19:13:14
问题 My app needs to read .rtf file from URL. I am going to read it as NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@.rtf",_URL]]; NSError* error; NSString *content = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:&error]; Now when I load this text in UITextView. It gives me tags with { and / characters with the original file text. Please guide me that how can i read the right text which did not include any brackets and html data. 回答1: .rtf file always

Strip RTF strings with PHP - Regex [duplicate]

风格不统一 提交于 2019-12-12 17:05:09
问题 This question already has answers here : Regular Expression for extracting text from an RTF string (10 answers) Closed 6 years ago . A column in the database I work with contains RTF strings, I would like to strip these out using PHP, leaving just the sentence between. It is a MS SQL database 2005 if I recall correctly. An example of the kind of strings pulled from the database (need any more let me know, all the rest are similar): {\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\fnil

How to change the font of multiple sizes in richtextbox in C#?

試著忘記壹切 提交于 2019-12-12 15:06:38
问题 I have a richtextbox and I would like to make it work like WordPad. My problem is that, for example, if I type "123" using the Calibri font, and then "456" using the Arial font and I want to change the size of 2345 it won't let me to do it because they have two different font types. This is where I have the problem: private void combo_sizes_TextChanged(object sender, EventArgs e) { if (rtb.SelectionFont == null) { rtb.SelectionFont = new Font(combo_fonts.Text, Convert.ToInt16(combo_sizes.Text

How to print .rtf file?

被刻印的时光 ゝ 提交于 2019-12-12 13:43:22
问题 How to print .rtf file using C#? (WinForms/WPF application) 回答1: From https://support.microsoft.com/en-us/kb/812425: In Visual C# .NET or Visual C# 2005, create a new Class Library project that is named RichTextBoxPrintCtrl. By default, Class1.cs is created. Change the name of Class1.cs to RichTextBoxPrintCtrl.cs. In Solution Explorer, right-click References, and then click Add Reference. In the Add Reference dialog box, double-click System.Drawing.dll and System.Windows.Forms.dll, and then

Does TRichEdit support Unicode?

我只是一个虾纸丫 提交于 2019-12-12 10:03:27
问题 I'm trying to write a wrapper class around TRichEdit that can encode and decode RTF to/from plaintext. This is what I've written so far: type TRTF = class private FRichEdit : TRichEdit; procedure SetText(const AText: string); function GetText: string; class function Convert(const AInput: string; AEncode: Boolean): string; inline; static; public constructor Create; destructor Destroy; override; class function Decode(const AInput: string): string; static; class function Encode(const AInput: