File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How to update an RTF template file in java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to update an RTF template file in java?" Watch "How to update an RTF template file in java?" New topic
Author

How to update an RTF template file in java?

Rod McLure
Greenhorn

Joined: Mar 04, 2010
Posts: 24
I want to open an RTF tempalte file and replace strings like "Insert Name here" with data from the database, then write out the new RTF file
I am using Java with Struts.
I don't need to create, or display the RTF template file
google has brought back RTFTemplate but it talks about Spring, Velocity, XML which I would rather not have to get into

Thanks
Rod
Martin Vanyavchich
Ranch Hand

Joined: Sep 16, 2008
Posts: 241
If files aren't too big and you have figured out how to read them properly, then look into StringBuilder class. That might be the answer.


SCJP 6, OCMJD 6, OCPJWSD 6
I no good English.
Rod McLure
Greenhorn

Joined: Mar 04, 2010
Posts: 24
no, I haven't figured out how to open or read an RTF file
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42906
    
  69
A templating engine like Velocity or FreeMarker should do nicely. Spring or any kind of XML needn't be involved.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4664
    
    5

Rod McLure wrote:no, I haven't figured out how to open or read an RTF file

An RTF file is a plain text file. Open it in Notepad or any text editor and see for yourself.


luck, db
There are no new questions, but there may be new answers.
Rod McLure
Greenhorn

Joined: Mar 04, 2010
Posts: 24
thanks, I found this, does what I want
http://forums.sun.com/thread.jspa?threadID=791257&start=15
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to update an RTF template file in java?