Text to RTF conversion

Hi All:
Is there any way to convert a text file into RTF using Java? Any sample code is highly appreciated.
Thanks in Advance,
Arivoli

A somewhat round-about way would be to filter it through a JTextPane via an RTFEditorKit. The code for it in is my Ekit program (along with a lot of other stuff), with source available here:
http://www.hexidec.com/ekit.php
Hope this helps.

Similar Messages

  • Anybody can help me for RTF conversion?

    Anybody can help me for RTF conversion for selected text frames only in Indesign by script

    ID has no built-in way to export a story as RTF with style labeling in a column next to the text, similar to what you would see in Story Editor view, but there is a remote possibility that this could be scripted (ask in InDesign Scripting) or perhaps you can make InDesign Tagged Text work for you. Try exporting a few paragraphs to tagged text and see if it would be useful.

  • AIR Exporting text into .rtf or .doc formats

    Hi
    I am developing an AIR application witch is similar to MS word or some other text editor . Problem is I need to implement a feature for exporting and importing text to .rtf .txt and .doc formats the editor can contains graphic elements too . please suggest me how do I done this.
    Thanks
    osurikiran

    Try this (in SQL*Plus)
    exec ctx_ddl.drop_policy ('mypol')
    exec ctx_ddl.create_policy ('mypol', 'ctxsys.auto_filter' )
    variable clobtofilter clob
    variable filteroutput clob
    begin
      :clobtofilter := '{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset238 CorporateSLight;}}
    \viewkind4\uc1\pard\lang1050\f0\fs24\ This is
    \par regular rtf file
    \par spanning
    \par several
    \par lines...
    \par The End
    \par }';
    dbms_lob.createtemporary( :filteroutput, true );
    ctx_doc.policy_filter ('mypol', :clobtofilter, :filteroutput, true );
    end;
    set long 500000
    print filteroutput

  • I can't view the latest text in a conversation

    I can't view the latest text in a conversation with iOS 8.1.3 I have an iPhone 5s. When I try to view the last text it automatically snaps up to the 3rd to last text.

    Did your designer was on the good context ?
    Look the list box at the top right of the Designer interface.
    You must have the same as the one where you define your journalization.

  • Is it possible to handle formatted text actions(RTF) using Clipboard?

    Hi All,
    Is it possible to handle formatted text actions(RTF) using Clipboard?
    My application requires to copy the contents from other applications like MS-Word and contents to be pasted in my Application..
    if so how?i appreciate for any piece of code or links to the same.
    Thanks and regds
    Mohan

    -Any Suggestions?

  • I have a 4 month long text message thread conversation. What's the quickest way to get to the very beginning of the conversation?

    I have a 4 month long text message thread conversation. What's the quickest way to get to the very beginning of the conversation?

    The startup.exe file is locate in the \NI-RT\STARTUP directory. 'cd NI-RT' then 'cd STARTUP' should get you to the right place after making the connection with ftp. I don't recognize PH_EXEC.EXE. Logging in as anonymous is fine. I don't recall seeing documentation on the file structure and locations on the module but I'm sure there is some. I just wandered around w/ftp.
    The program to update the node should be below. Enter the IP address, the green light will confirm the node is found.
    The version function scans the existing startup.exe for a string beginning and ending with " RU Version " and prints everything in between as the version.
    The autostart function will copy the existing ni-rt.ini file to your computer, mod
    ify the autostart as requested, then put the file back. Leaves the copy on the PC, which can be handy.
    Send file will request a file of the format startup*.dat which will be renamed startup.exe and ftp'd to the module. Lets you keep version numbers in the filename on the PC side. Your directory structure probably won't match mine so you'll have to browse for your file.
    Reboot module reboots the module.
    Hope this is useful, let me know if anything doesn't make sense. Thanks.
    Matt
    Attachments:
    RNconfig.exe ‏855 KB

  • Framemaker to RTF conversion script

    Hello,
    I have an requirement for a script to do FM to RTF conversion scripts?
    Can someone provide any references or samples for this.
    Thanks & Regards,
    Shail

    Shail,
    The most robust solution – if FrameMaker’s own RTF export is not sufficient – is Mif2Go from Omni System. Check out
    http://www.omsys.com
    - Michael

  • Saving Mail messages as text or rtf to a server makes them invisible

    If I save an email message as text or rtf to a LaCie NAS server, the resulting file is tagged as invisible. If I save it to the Mac's hard disk it is not. It's relatively easy to untag the files, but I need to save dozens on some days and it's laborious. Any ideas … ?

    It gets worse. I have just saved an incoming mail message with three attached photos. It said it was saving the images (hooray) and it created an RTFD file (folder). However, when I opened the saved document there were no images! Very very odd...
    Some readers may think that I must be getting it all wrong and this is just pilot error. I can here reassure them that is not the case; I am a technically competent Apple user of some 25 years' experience. I am not a code monkey though; I can strip down and reassemble a thirty year old naturally aspirated performance engine but I would not be able to do anything under the hood which involved chips and computers!
    It is a difficult one to pin down but I will be very interested to know if any other Lion upgraders are experiencing similar problems, however ill-defined.
    Drew

  • Text to voice conversion

    hi
    i need a codings for text to voice conversion in java
    please help me.

    Thank you for the 8th exciting version of this question.
    http://java.sun.com/products/java-media/speech/

  • Images Behind Text in RTF Template

    While creating a few rtf templates, I noticed that if an image is to be shown behind text then the image will not render to back to .rtf by bi pub.
    If I put the image inline with text, it renders just fine.
    Am I missing a step that would allow me to render the image behind text or is it just working as intended?
    Oracle BI Publisher 10.1.3.4.1
    Thank you.
    Edited by: Crawler409 on Dec 17, 2010 2:49 PM
    Edited by: Crawler409 on Dec 17, 2010 2:50 PM

    Hi
    Can you pl. send me the RTF template and sample XML. I will try to fix the template.
    Thx
    chundi ([email protected])

  • How to hide a text in RTF Editor

    Hi,
    I'm trying to create a RTF editor using JTextPane, RTFEditorKit and DefaulStyledEditor.
    Does somebody know how to hide a text in a RTFEditorKit ?
    Thanks in advance
    Maurice

    What about
    setVisible(false);
    Haven't tried it, no clue wether is works. If u need to select a certain portion of the text this might help:
    int posStart = editorPane.getSelectionStart( );
    int posEnd = editorPane.getSelectionEnd( );
    int selLength = posEnd - posStart;

  • Error with PS text after Unicode conversion

    Hi, we are having problem after doing unicode conversion with special
    character not displayed correctly in a Web interface. In SAP
    (transaction CN04) everything is OK, but if the PS text is displayed
    through a Web interface (BSP for instance) some characters are
    displayed wrong. One of these characters is the apostrophe in French
    language ('). Is there an available tool to perform a conversion of
    existing PS text after performing unicode upgrade ?

    Hima ... try this
    http://<server>/Lighthammer/JCOProxy?Mode=Reset

  • Format/hyperlink certain text in the conversation window using an API plugin

    Hi, I want to format/hyperlink certain text and make it clickable in the conversation window of Lync. The click itself will execute a Desktop application.
    Is this possible via an API plugin and is there example code on how to manipulate the conversation window?
    Thanks!

    Hi wyatt biker,
    To ensure you get better support, I suggest you turn to our Lync Development forum for dedicated support.
    With the assistance provided there, it is more likely the issue can be resolved. Sorry for any inconvenience this caused. Thanks for your understanding.
    Best regards,
    Eric

  • HTML to RTF conversion

    Hello. I am trying to convert a simple html string and produce a rtf file using the HTMLEditorKit and RTFEditorKit. I have already found some topics which cover the process and their authors warn that the output RTF will not contain images and tables. But what strikes me is that i can't even get new lines and paragraphs in the RTF-file. Here is the example code. The output RTF document contains just a single line of text. Thank you in advance!
    import java.io.*;
    import javax.swing.JEditorPane;
    import javax.swing.JFrame;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.DefaultStyledDocument;
    import javax.swing.text.html.HTMLDocument;
    import javax.swing.text.rtf.RTFEditorKit;
    import javax.swing.text.html.HTMLEditorKit;
    public class MainController {
         private DefaultStyledDocument htmlDoc;
         private HTMLEditorKit htmlKit;
         private RTFEditorKit rtfKit;
         public MainController() {
              htmlDoc = new HTMLDocument();
              htmlKit = new HTMLEditorKit();
              rtfKit = new RTFEditorKit();
         private void convert(String strText) {
              StringReader reader = new StringReader(strText);
              try {
                   htmlKit.read(reader, htmlDoc, 0);
                   FileOutputStream f = new FileOutputStream("rtfdoc.rtf");
                   rtfKit.write(
                        f,
                        htmlDoc,
                        0,
                        htmlDoc.getLength());
                   JEditorPane pane = new JEditorPane("text/html", strText);
                   JFrame frame = new JFrame();
                   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                   frame.getContentPane().add(pane);
                   frame.setSize(300,300);
                   frame.show();
                   Thread.sleep(5000);
              catch (IOException ie) {
              catch (BadLocationException ble) {
              } catch (InterruptedException e) {
                   e.printStackTrace();
         public static void main(String args[]) {
              MainController conv = new MainController();
              String strRTF =
                        "<html><head><p class=default><span style=\"color: #000000\">Test </span><span style=\"color: #000000\"><b>line</b> </span><span style=\"color: #000000\"><i>1</i> </span></p>" +
                        "<p class=default><span style=\"color: #000000\">Test </span><span style=\"color: #000000\"><b>line</b> </span><span style=\"color: #000000\"><i>2</i> </span></p></head></html>";
              conv.convert(strRTF);
              System.exit(0);
    }

    When you post code, please use [code] and [/code] tags as described in Formatting Help on the message entry page. It makes it much easier to read and prevents accidental markup from array indices like [i].

  • API to extract text from RTF to XLIFF

    Can the java api be used to extract text to XLIFF from RTF files? If so, can someone point me to the javadoc for this feature.

    > Do you know of any other way this can be done?
    There are many ways. But this out of scope of this forum. You can try this forum: http://forum.planetpdf.com/

Maybe you are looking for