Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

convert RTF to HTML

Posted on 2007-11-25
6
Medium Priority
?
3,651 Views
Last Modified: 2013-12-29
Can anybody tell me where i can find java implemetation of RTF to HTML and vice-versa.
0
Comment
Question by:sasankad
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
ysnky earned 600 total points
ID: 20348475
0
 
LVL 3

Expert Comment

by:ramiseesniblic
ID: 20778428
A couple of questions:

1. Does the HTML need to be XHTML complient?
2. Do you have access to java SWING?
0
 
LVL 3

Expert Comment

by:ramiseesniblic
ID: 20778941

public static void main(String[] args) {
  try {                                    
    Writer sOut = new StringWriter();
    FileWriter out = new FileWriter("C:\\rtf\\test.html");
    FileInputStream fi = new FileInputStream( "C:\\rtf\\test.RTF" );
    try{
                  
      DefaultStyledDocument doc = new DefaultStyledDocument();                  
      HTMLEditorKit htmlKit = new HTMLEditorKit();                  
      RTFEditorKit rtf = new RTFEditorKit();
    
      rtf.read( fi, doc, 0 );
      htmlKit.write(sOut, doc, 0, doc.getLength());
    
      out.write(sOut.toString());    
    }finally{
      sOut.close();
      out.close();
      fi.close();
    }              
 
  }catch( Exception e ){
    System.out.println( e.toString() );
  }
}

Open in new window

0
 
LVL 1

Expert Comment

by:Yogeshup
ID: 34152609
Can any one suggest me HTML to RTF for java applications?
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

879 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question