rtf

Is there a free way to convert RTF to PDF?

这一生的挚爱 提交于 2019-11-27 00:37:59
问题 How can I programmatically convert RTF documents to PDF? 回答1: OpenOffice.org can be run in server mode (i.e. without any GUI), can read RTF files and can output PDF files. 回答2: You have a number of options depending on: the platform(s) your application will be running on whether your application will be a server application (e.g. a web service that you set up once and then it runs), or a widely-available desktop application (e.g. something that must be easily downloadable and installable by

Programmatically adding Images to RTF Document

半世苍凉 提交于 2019-11-26 22:14:45
I am trying to add a image to a RTF document which I am creating. I would prefer to not use 'copy/paste' methods (that involve pasting the image within a RichTextBox and then accessing the .RTF property) which purge the clipboard (as this will be a bother and confusion for my end users). The code I have so far returns the string that needs to be inserted into the RTF document to print the image. The inputted image (located at $path) is usually in bmp or jpeg format, but at this stage I am not concerned with how the image is stored within the RTF only that i can get it to work. public string

fast way to copy formatting in excel

不羁岁月 提交于 2019-11-26 20:57:33
问题 I have two bits of code. First a standard copy paste from cell A to cell B Sheets(sheet_).Cells(x, 1).Copy Destination:=Sheets("Output").Cells(startrow, 2) I can do almost the same using Sheets("Output").Cells(startrow, 2) = Sheets(sheet_).Cells(x, 1) Now this second method is much faster, avoiding copying to clipboard and pasting again. However it does not copy across the formatting as the first method does. The Second version is almost instant to copy 500 lines, while the first method adds

What is the RTF syntax for a hyperlink?

三世轮回 提交于 2019-11-26 20:41:40
HTML is to <a href="x">y</a> as RTF is to _______ ? {\field{\*\fldinst HYPERLINK "http://www.google.com/"}{\fldrslt http://www.google.com}} Vlad P. The last article works fine. I even took it further to display multiple links (and replaced \par to \line tags in order to stay in the same paragraph). {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Calibri;}} {\colortbl ;\red0\green0\blue255;} {\*\generator Msftedit 5.41.21.2509;}\viewkind4\uc1\pard\sa200\sl276\slmult1\lang9\f0\fs22 {\field{\*\fldinst{HYPERLINK "http://www.google.com"}}{\fldrslt{\ul\cf1This is a Google URL}}

Is it possible to display an RTF file inside a web page using PHP?

僤鯓⒐⒋嵵緔 提交于 2019-11-26 16:36:01
问题 I have an RTF file that I want to display inside a web page after tags have been replaced with user input. I would like to be able to display the RTF file without having to convert it to something before displaying it. Every time I try it now it gives me the popup open/save box even though I am telling it to display it inline with: header("Content-type: application/msword"); header("Content-Disposition: inline; filename=mark.rtf"); header("Content-length: " . strlen($output)); echo $output;

Using TRichEdit at runtime without defining a parent

蓝咒 提交于 2019-11-26 15:56:57
问题 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

Using Tables in RTF

允我心安 提交于 2019-11-26 14:28:35
问题 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

Reset RTF in RichTextBox?

瘦欲@ 提交于 2019-11-26 14:08:12
问题 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

How can I insert an image into a RichTextBox?

情到浓时终转凉″ 提交于 2019-11-26 12:16:47
Most of the examples I see say to put it on the clipboard and use paste, but that doesn't seem to be very good because it overwrites the clipboard. I did see one method that manually put the image into the RTF using a pinvoke to convert the image to a wmf. Is this the best way? Is there any more straightforward thing I can do? The most straightforward way would be to modify the RTF code to insert the picture yourself. In RTF, a picture is defined like this: '{' \pict (brdr? & shading? & picttype & pictsize & metafileinfo?) data '}' A question mark indicates the control word is optional. "data"

RTF to Plain Text in Java

安稳与你 提交于 2019-11-26 11:37:53
问题 How do you convert an RTF string to plain text in Java? The obvious answer is to use Swing\'s RTFEditorKit, and that seems to be the common answer around the Internet. However the write method that claims to return plain text isn\'t actually implemented... it\'s hard-coded to just throw an IOException in Java6. 回答1: I use Swing's RTFEditorKit in Java 6 like this: RTFEditorKit rtfParser = new RTFEditorKit(); Document document = rtfParser.createDefaultDocument(); rtfParser.read(new