Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert rtf into javadoc/html 1

Status
Not open for further replies.

TonHu

Programmer
Dec 13, 2001
1,292
NL
Hi,

Anybody been converting from rtf to javadoc and/or html?

I'd like to convert (database)stored rtf documentation into a javadoc comment block inside some generated java source. The pasting into the sources is no problem, just looking for an existing parser/converter. Else I'll have to write one up myself, which I'd like to avoid (pure lazyness I guess), and surely not try to re-invent an existing wheel.

TIA
TonHu
 
Yeah, I found that already, but it just gives me the plain ascii text of the document, and I'd like to convert to 'html encoded', as that's (at least partially) supported in JavaDoc, AFAICT. So a bold sentence in rtf, should come out like <b>bold</b> to be added to the generated source.

TIA
TonHu
 
Thanks for the nice links!

I did use google to search for these terms ofcourse, but came up with so many links, and none as informative as these, that I looked at.
The last link you gave looks to be in the direction I'm pursuing, but it NPE's at me, so I'll pull out the debugger, and see where it fails. I'll report back later.

THNX
TonHu
 
A small update:

So I tried with the proposed solution, and I'm able to convert rtf to html, it has a 'limitation' that it requires some minimum rtf attributes, before it is able to convert, or it will NPE, f.e. an empty string for input results in a NPE... A really limited rtf string like
Code:
{\rtf1} Some \b bold\b0 text}
also results in a NPE.
I have to add the fonttable entry and define a font and fontsize in the rtf to get it going.

This all is to blame on the rather limited rtf control I'm using in my environment... it delivers only the minimal rtf.

All this is much more I can afford for now (in time) so I gave up for the moment, other projects have bigger priority.

Thnx,
TonHu
 
Humm, people don't use to come back with their results.

You did, and that will be useful for other people. My star.

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top