rtf

Invoking Word for rtf to docx conversion

旧街凉风 提交于 2019-11-30 05:15:16
问题 I have a need to routinely programmatically convert *.rtf files into *.docx. Manually, this works just fine with Save As inside Word 2007 ... the resulting docx behaves just fine. Programmatically, I can't get it to work. What I tried is basically the following: Fetch RTF from Word ... but in the reverse direction. Instead of opening *.docx and using SaveAs to *.rtf, I'm opening the *.rtf and using SaveAs to *.docx. However, the resulting file won't open, and so evidently there's something I

wix specify licence shows nothing

拈花ヽ惹草 提交于 2019-11-30 04:12:37
I'm trying to specify the licence for my wix setup project. I have created a rtf with a few dummy lines in wordpad/notepad/vs tried a few different ways as I read there was an issue with ones created in word but I dont think that should apply here, in any case I also opened it up in notepad++ and verified there is no funky characters hidden in it. I am specifying the file like so <WixVariable Id="WixUILicenseRtf" Value="$(var.ProjectDir)\Resources\test.rtf" /> And the file exists under the project\Resources directory. When I run the installer all that is shown in the licence area is a blank

RTF Bullet List Example

99封情书 提交于 2019-11-30 02:34:32
问题 It seems impossible to find a very simple working example for an RTF bullet list that looks like this: Hello World Nested (but with square as bullet please) Also nested (also square bullet) and regular again I tried to make a small sample by using Word or TextEdit.app but they produce a lot of garbage. Can anyone help out? 回答1: If you looked in the Word or Wordpad formatted RTF long enough, you would find some lines that look like this: {\f2 {\pntext \'B7\tab}{*\pn\pnlvlblt\pnstart1{\pntxtb\

Read (and write) RTF files with C++ / Qt [closed]

半城伤御伤魂 提交于 2019-11-30 01:19:13
问题 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 5 years ago . I am looking for a simple C++ library for tokenizing and parsing RTF (Rich Text Format) files. I am planning to edit them with Qt's QTextEdit. More the Formatting preserved the better -- but actually I am planning to use Bold and Italics only. In perl I would use RTF::Tokenizer. It would be nice if the module

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

独自空忆成欢 提交于 2019-11-29 17:29:42
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 being in RTF and the output needing to be in PDF. This needs to run on an ASP.NET server. No it is not possible per se with iTextSharp. Better approach will be to use Word Object to open document, do mailmerge and then save those documents ad HTML. Now you can

Writing unicode to rtf file

我只是一个虾纸丫 提交于 2019-11-29 16:02:22
I´m trying write strings in diffrent languages to a rtf file. I hav tried a few different things. I use japanese here as an example but it´s the same for other languages i have tried. public void writeToFile(){ String strJapanese = "日本語"; DataOutputStream outStream; File file = new File("C:\\file.rtf"); try{ outStream = new DataOutputStream(new FileOutputStream(file)); outStream.writeBytes(strJapanese); outStream.close(); }catch (Exception e){ System.out.println(e.toString()); } } I alse have tried: byte[] b = strJapanese.getBytes("UTF-8"); String output = new String(b); Or more specific: byte

Converting from rich text format to plain text problems

我与影子孤独终老i 提交于 2019-11-29 14:48:36
We currently have an application (Windows service) that connects to another of our applications and grabs invoices. In the invoices there is a RTF field for the footer/header fields. When we grab the data the RTF is converted to plain text with the following code: public static string ConvertFromRTFToPlainText(string rtfString) { if (rtfString == null) return null; System.Windows.Forms.RichTextBox rtBox = new System.Windows.Forms.RichTextBox(); if (rtfString.StartsWith("{\\rtf1")) rtBox.Rtf = rtfString; else rtBox.Text = rtfString; return rtBox.Text; } This has worked for the most part but in

How to create RTF from plain text (or string) in C#?

懵懂的女人 提交于 2019-11-29 13:46:42
Could anyone please help me to create RTF from string in C#? I save all the formats (bold, italic, etc) in a customized class. Jerry I'd use an external library instead of coding your own. Check these projects: http://sourceforge.net/projects/netrtfwriter/ http://www.codeproject.com/Articles/11306/NRTFTree-A-class-library-for-RTF-processing-in-C You might also be able to use the Rtf property of the RichTextBox control (if your users are entering data in such a control). As the simplest option, you can use RichTextBoxControl in winforms application. richTextBox1.SaveFile(@"C:\temp\test.rtf",

How to make some text bold in a rich text box in C#

时光总嘲笑我的痴心妄想 提交于 2019-11-29 12:36:33
问题 I want to create a text editor where I can make text bold, change its color, etc. I found this code to approximately work: public static void BoldSelectedText(RichTextBox control) { control.SelectionFont = new Font(control.Font.FontFamily, control.Font.Size, FontStyle.Bold); } But when I type in more letters in the RichTextBox the text is still bold. How can I make it so that only the selected text is bold and the next characters aren't unless I select the text and hit the "Make Bold" button?

Links inside rich textbox?

两盒软妹~` 提交于 2019-11-29 11:04:42
问题 I know that richtextboxes can detect links (like http://www.yahoo.com) but is there a way for me to add links to it that looks like text but its a link? Like where you can choose the label of the link? For example instead of it appearing as http://www.yahoo.com it appears as Click here to go to yahoo edit: forgot, im using windows forms edit: is there something thats better to use (as in easier to format)? 回答1: Of course it is possible by invoking some WIN32 functionality into your control,