Sorry too much typos that I cannot even read it myself. Changes as below.
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Shane
Duan
Sent: Tuesday, January 09, 2001 12:35 PM
To: [EMAIL PROTECTED]
Subject: Re: Again with RTF
Eric,
I did this before and I think you might try the following solution.
Using MS Word application to create a document as a template.
Because the formatting of the document should be the same all the time, and
what is changing is the content (or the value of the fields). So at the
place where you want the servlet to generate different values for different
user, put something weird but meaningful as a tag holder, e.g. !@#Name!@#.
Then you save this template as a RTF file. When you are using the servlet
to generate the output file, you can just read in the whole file into a
StringBuffer, then replace the tag holder
with the real value. For example, change !@#Name!@# to 'Mr. Smith'. (It
might be faster if you do the replacement while you read the file).
Basically, you use word to generate the RTF formatting characters
and use
servlet the fill in the values.
Hope that'll help.
Shane
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
Valderrama, Eric
Sent: Tuesday, January 09, 2001 8:41 AM
To: [EMAIL PROTECTED]
Subject: Again with RTF
Hi,
I've been checking the archives but i didn't find the integral solution to
my problem. I sent a mail before related with how to create word documents,
but that idea it was a little difficult to implement with servlets. Finally,
I decided that the most feasible way to develop my application is to create
a RTF document.
However, I don't know how to join the answers to the both problems, that is
to create a RTF document and to save it in a specific folder. I have a weak
idea of how to create the document, i. e. doing
setContentType("application/rtf") and then
out.print({\\rtf1\\ansi\\ansicpg1252\\deff0\\deftab720{\\fonttbl{\\f0\\fswis
s MS Sans Serif;}...[blah, blah...] ...);
And I have another idea of how to write a file without showing it, i. e.
using a BufferedWriter object and so on.
I hope you can help me in this problem, because I don't know how to
integrate both solutions in order to develop my application. But it could be
possible that I don' t have the right solutions to this, so I hope you can
orientate in a good way.
I will really appreciate your answers
Thanks in advance.
-Eric-
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html