rtf

Unexpected result of RTF line ending conversion

倖福魔咒の 提交于 2019-12-02 02:35:48
If txtLog is a RichTextBox control: Dim text = "hi" & vbCrLf Debug.WriteLine("t:" & text.Length) ' --> 4, as expected txtLog.Text = text Debug.WriteLine("tL:" & txtLog.TextLength) ' --> 3. muh?! :( Having looked at the RTF spec , the end of a paragraph is notated as \par , which is neither CR nor LF . This makes sense since RTF is markup language; like in HTML, line endings have little meaning on their own. So presumably, on writing into the RichTextBox , my line ending is being encoded into \par . And then, on extraction, the \par is being translated back to a real line ending for use. It

Merge multiple doc or rtf files into a single doc or rtf file by using php script

天大地大妈咪最大 提交于 2019-12-02 00:21:23
I would like to merge multiple doc or rtf files into a single file which should be the same format of multiple files. What I mean is that if a user selects multiple rtf template files from a list box and clicks on a button on web page, the output should be a single rtf file which combines multiple rtf template files, I should use php for this. I haven't decided the format of template files, but it should be either rtf or doc, and also I assume that template file has some images as well. I have spent many hours to research the library for this, but still can't find it out. Please help me out

RTF to PDF in Java

北战南征 提交于 2019-12-01 18:56:07
We are building an application which partially interacts with other system. We are pulling some data from the other system which is returned as RTF document. But we have to prevent users from editing this file, so we thought about converting it with iText into PDF. Code snippet: // moving the rtf data into input stream to be used in RTF parser ByteArrayInputStream rtfInputStream = new ByteArrayInputStream(rtfStream.toByteArray()); // set headers resp.setHeader("Cache-Control", "no-store"); resp.addHeader("Content-Type", "application/pdf"); resp.addHeader("Content-Disposition", "inline;

Send an e-mail with rtf text in delphi

谁说胖子不能爱 提交于 2019-12-01 17:27:38
问题 I would like to perform the following task: converting a TRichEdit content (an rtf text) into a not-plain-text e-mail message body. MAPI doesn't support rtf, but is there a way to do it maybe with Indy? The problem is that rtf is rtf and emails are plain text or HTML. Can someone suggest a trick? Is it possible to convert rtf to text using TWebBrowser? Basically the scenario is: 1) User writes email in a delphi form, 2) The email is then sent with MAPI to the default mail client (so a new

Merge RTF files

守給你的承諾、 提交于 2019-12-01 17:27:17
I have a set of RTF's stored in strings in C# is their a way to merge these into one document for printing as the user wants to print them as one document with the print settings appearing once. I can use office interop if necessary, obviously avoiding this is better. Edit: A page break would be necessary between each document I think I can just insert \page for this though Here you go (C# code's included in) You would have to remove the trailing } from the first document. You would have to remove the {\rtf1... and {fonttbl.. and {colortbl... sections from the second document. Might need to

Merge RTF files

二次信任 提交于 2019-12-01 15:54:36
问题 I have a set of RTF's stored in strings in C# is their a way to merge these into one document for printing as the user wants to print them as one document with the print settings appearing once. I can use office interop if necessary, obviously avoiding this is better. Edit: A page break would be necessary between each document I think I can just insert \page for this though 回答1: Here you go (C# code's included in) 回答2: You would have to remove the trailing } from the first document. You would

Copying .rtf text into the body of an email with AppleScript

岁酱吖の 提交于 2019-12-01 14:06:53
I have an AppleScript application which creates an email (in Mail.app) with attachments from the options I choose through dialogs. The text templates are stored in .rtf format so non-programers can alter the text templates to their wishes. I am able to create an email from a .txt plain text file, but when I import an .rtf text file it imports the formatting commands, which I don’t want in the mail. Here is an example of a .rtf import into an email: {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fswiss\fcharset0 Helvetica-Light;} {\colortbl;\red255\green255\blue255;} \pard

Extracting images from RichTextBox

折月煮酒 提交于 2019-12-01 11:31:49
I have an application where users may insert images into a RichTextBox. I'd like to be able to replace all the images in the RTF with some token and store the images in separate files. I'll inject the images back into the RTF later. I've managed to get the insertion working but ended up resorting to pasting them via the Clipboard (very like Insert an image into RTF document in C# ). The trouble now is how to extract the images. How do I programatically select an image in a RichTextBox? Do I have to go back through the clipboard? Something like: IDataObject data = Clipboard.GetDataObject();

Import external RTF file for TRichEditViewer?

╄→尐↘猪︶ㄣ 提交于 2019-12-01 09:46:58
问题 I'm using TRichEditViewer on a custom page in an Inno Setup script. Is it possible to read an external RTF file into a variable, and use that variable as the content of the viewer? Or do I have to keep the actual RTF code in the script? Any help gratefully received. 回答1: You should be able to use LoadStringFromFile to read an RTF file into a string. From the Inno documentation: Prototype: function LoadStringFromFile (const FileName: String; var S: AnsiString): Boolean; Description: Loads the

Import external RTF file for TRichEditViewer?

核能气质少年 提交于 2019-12-01 09:37:31
I'm using TRichEditViewer on a custom page in an Inno Setup script. Is it possible to read an external RTF file into a variable, and use that variable as the content of the viewer? Or do I have to keep the actual RTF code in the script? Any help gratefully received. You should be able to use LoadStringFromFile to read an RTF file into a string. From the Inno documentation : Prototype: function LoadStringFromFile (const FileName: String; var S: AnsiString): Boolean; Description: Loads the specified binary or non Unicode text file into the specified string. Returns True if successful, False