rtf

JAVA - set font of selectedtext in a JEditorPane

梦想的初衷 提交于 2019-12-11 01:35:08
问题 How can I set the font/bold/italic/underline whatever of some text in a JEditorPane? I am trying to create a simple document editor, but i can only figure out how to set the font/bold/italic/whatever of the ENTIRE JEditor/JText pane. RTF is preferred, HTML is fine as well. 回答1: JEditorPane.getDocument() returns an instance of StyledDocument. StyledDocument has setCharacterAttributes() method to set the font properties. Related example: http://www.java2s.com/Code/JavaAPI/javax.swing

Convert RTF to HTML in .NET

别来无恙 提交于 2019-12-11 01:31:03
问题 I've managed to do the reverse using WebBrowser and RichTextBox . But how would I convert RTF to HTML? 回答1: Disclaimer: I'm working for this company. As I see, the question is old but maybe someone search solution for this too. Our component RTF to HTML allows to convert RTF to HTML. You may download a component or try online-demo. Try the trial version first if you have a doubt. :) Trial is free. Here's the code sample for the converting from RTF to HTML in ASP.NET: SautinSoft.RtfToHtml r =

Convert VarBinary RTF blob to text in MS SQL

岁酱吖の 提交于 2019-12-11 01:27:35
问题 I am using SQL server - 2008. Column Datatype - VarBinary RTF File is compressed and saved to this varbinary column. Now how to access and view data in RTF file using SQL ? it's returns this: 㠰た㠴弰巎楛㵤㠵㜸ㄲ㠴. etc. Sample Tried Code here: http://rextester.com/YOFHK34016 any solution to this. in 2008 Decompress and compress function not work. how i can get RTF file as it is to text. 回答1: That's works for me: select convert(varchar(max),convert(varbinary(max),bv.value)) from blobValue bv Instead

How do I convert Rtf to Text using ASP.Net?

主宰稳场 提交于 2019-12-11 00:53:39
问题 How do I convert To Text Format from RTF using ASP.Net? 回答1: You have instructions on MSDN In C# class ConvertFromRTF { static void Main() { string path = @"test2.rtf"; //Create the RichTextBox. (Requires a reference to System.Windows.Forms.dll.) System.Windows.Forms.RichTextBox rtBox = new System.Windows.Forms.RichTextBox(); // Get the contents of the RTF file. Note that when it is // stored in the string, it is encoded as UTF-16. string s = System.IO.File.ReadAllText(path); // Display the

How to correctly print out a hard copy of a JTextPane with “text/rtf” content?

耗尽温柔 提交于 2019-12-10 20:16:46
问题 I'm trying to print out some simple RTF-formatted text to a laser printer using a JTextPane . The result looks fine on a software PDF printer (FreePDF XP), but the text doesn't have proper space between it's formatted parts when print to a real printer. Edit: I have uploaded an example output (The bottom is the scanned printout) Example http://ompldr.org/vNXo4Zg/output.png It seems to me that there is a problem with the Graphics object starting to paint the indiviual parts of the RTF code. As

Broken tables in RichTextBox control (word wrap) [duplicate]

北城以北 提交于 2019-12-10 17:08:33
问题 This question already has an answer here : Closed 6 years ago . Possible Duplicate: Why isn’t the richtextbox displaying this table properly? We are having problems with the Windows.Forms.RichTextBox control in Visual Studio 2008. We are trying to display text supplied as an RTF file by a 3rd party in a windows forms application (.NET 3.5). In this RTF text file there are tables, which contain text that spans multiple lines. The RTF file displays correctly when opened with either WordPad or

How do I extract/insert text into RTF string in C#

谁说我不能喝 提交于 2019-12-10 16:52:14
问题 In a C# console app I have the need to extract the text from an RTF string, add some more text to it, and then convert it back into RTF. I have been able to do this using the System.Windows.Forms.RichTextBox class, but I find it a bit odd to use a Forms control in a non-Forms app. Any better way to do this? 回答1: Please see discussion on this topic: Cleaning up RTF text 回答2: Doing anything with RTF is pretty difficult unless you're using the windows forms. As stated above, using forms is the

Is there an RTF display widget in SWT

房东的猫 提交于 2019-12-10 16:50:13
问题 I would like to display an RTF document in an SWT (actually Eclipse RCP) application. I know there is a Swing widget for displaying and editing RTF text, but it is Swing and quite alien in look and feel when used in the otherwise platform (not to mention that to the last of my knowledge it did not display images and had only limited support for formatting) Other options is to use COM interface on windows, but that works only on the windows platform and requires that an ActiveX RichEdit contol

Underline not detected after reloading RTF

一个人想着一个人 提交于 2019-12-10 13:15:36
问题 I'm currently trying to get a RichTextBox with basic formatting working for my new beta notes software, Lilly Notes. Brian Lagunas' article on the subject put me in the right direction, however I'm having a bit of an issue. If you click on underlined text, the Underline button becomes pressed, so the state is being recognised. However if I serialize it to RTF and then deserialize it back into the RichTextBox, then it doesn't get detected. Since the code in Lilly Notes is not trivial to

How to generate RTFs with PHP

家住魔仙堡 提交于 2019-12-10 13:11:38
问题 I need to generate an RTF from within PHP. I've seen several libraries out there but wondering if anyone has used any of them or if they've just hand coded their own (which I'm perfectly able to do). Any opinions out there? TIA 回答1: Well, I've used PhpRtf and it was very good. You can download it at http://sourceforge.net/projects/phprtf/ 回答2: bz-htmlcss2rtf please try with this. http://joseluisbz.wordpress.com/2014/04/26/working-rtf-html-css-and-script-files-with-my-own-packages-java-and-php