Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Rhino Newsgroups: comp.lang.java.programmer Subject: Re: Generate Word-readable documents with Java? Date: Wed, 13 Jul 2011 03:56:34 +0000 (UTC) Organization: Your Company Lines: 25 Message-ID: References: NNTP-Posting-Host: MWk8cCl7gTasXNfp1B6zQg.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org User-Agent: Xnews/5.04.25 X-Antivirus-Status: Clean X-Notice: Filtered by postfilter v. 0.8.2 X-Antivirus: avast! (VPS 110712-1, 2011-07-12), Outbound message Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6148 ram@zedat.fu-berlin.de (Stefan Ram) wrote in news:RTF-20110713012911@ram.dialup.fu-berlin.de: > Ten Blade writes: >>I'd like to generate a moderately complex document (text, graphics, >>tables, bulleted lists) with Java code that can be read by Microsoft >>Word users. It's not important to me whether these document is in the >>traditional 'doc' format or something else like .xml. > > Untested: > > public class Main > { public static void main( final java.lang.String[] args ) > throws java.lang.Throwable > { final java.io.File outFile = new java.io.File( "example.rtf" ); > final java.io.PrintWriter out = > new java.io.PrintWriter( new java.io.FileOutputStream( outFile ), > true ); out.println( "{\\rtf1{\\fonttbl{\\f0 Arial;}}\\f0 > example\\par}" ); out.close(); } > Good point; I could write RTF documents. Thanks! -- Rhino