Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Generate Word-readable documents with Java?

Reply
Thread Tools

Generate Word-readable documents with Java?

 
 
Ten Blade
Guest
Posts: n/a
 
      07-12-2011
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.

I've been researching via Google and there was some buzz about
WordProcessingML several years ago but very little since. POI, which has
been under development for years, is apparently _STILL_ too immature to be
much use.

I've been away from Java for a few years and haven't kept up with most of
it. How are Java developers generating Word-readable documents these days?
I don't want to waste my time learning a technique or technology that was a
fad for a couple of weeks in 2007 and would prefer a well-regarded widely-
used approach if such a beast exists.


--
Ten-Blade
 
Reply With Quote
 
 
 
 
lewbloch
Guest
Posts: n/a
 
      07-12-2011
On Jul 12, 3:59*pm, Ten Blade <(E-Mail Removed)> wrote:
> 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.
>
> I've been researching via Google and there was some buzz about
> WordProcessingML several years ago but very little since. POI, which has
> been under development for years, is apparently _STILL_ too immature to be
> much use.
>
> I've been away from Java for a few years and haven't kept up with most of
> it. How are Java developers generating Word-readable documents these days?
> I don't want to waste my time learning a technique or technology that wasa
> fad for a couple of weeks in 2007 and would prefer a well-regarded widely-
> used approach if such a beast exists.
>


1 - Word can read text documents just fine.

POI works great. I don't know why you denigrate it.
http://poi.apache.org/

It's what Java developers are using to generate Word-readable
documents these deays. It's well regarded and widely used.

You can also use the Java interface to Open Office, which creates
ZIPped XML files in ODF (Open Document Format), which I think I heard
Word supports these days.

OO also exports to RTF and .doc formats.

--
Lew

 
Reply With Quote
 
 
 
 
Stefan Ram
Guest
Posts: n/a
 
      07-12-2011
Ten Blade <(E-Mail Removed)> 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(); }

 
Reply With Quote
 
Ten Blade
Guest
Posts: n/a
 
      07-13-2011
lewbloch <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> On Jul 12, 3:59*pm, Ten Blade <(E-Mail Removed)> wrote:
>> I'd like to generate a moderately complex document (text, graphics,
>> table

> s,
>> 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.
>>
>> I've been researching via Google and there was some buzz about
>> WordProcessingML several years ago but very little since. POI, which
>> has been under development for years, is apparently _STILL_ too
>> immature to b

> e
>> much use.
>>
>> I've been away from Java for a few years and haven't kept up with
>> most of it. How are Java developers generating Word-readable
>> documents these days

> ?
>> I don't want to waste my time learning a technique or technology that
>> was

> a
>> fad for a couple of weeks in 2007 and would prefer a well-regarded
>> widely

> -
>> used approach if such a beast exists.
>>

>
> 1 - Word can read text documents just fine.
>
> POI works great. I don't know why you denigrate it.
> http://poi.apache.org/
>

I've never used it. But, based on http://poi.apache.org/hwpf/index.html,
POI sounds rather immature so far. For example: "HWPF is still in early
development." And then there was this: "At the moment we unfortunately do
not have someone taking care for HWPF and fostering its development. What
we need is someone to stand up, take this thing under his hood as his
baby and push it forward. Ryan Ackley, who put a lot of effort into HWPF,
is no longer on board, so HWPF is an orphan child waiting to be adopted."

But maybe that information is out-of-date and doesn't reflect the reality
today.

> It's what Java developers are using to generate Word-readable
> documents these deays. It's well regarded and widely used.
>

Okay, looks like believing the developer team was not the right thing to
do....

> You can also use the Java interface to Open Office, which creates
> ZIPped XML files in ODF (Open Document Format), which I think I heard
> Word supports these days.
>
> OO also exports to RTF and .doc formats.
>

I've been messing with OO a bit but couldn't get the "Hello World"
program to work and couldn't get any help on my problem from the OO
forums so I'm inclined to try something different....

> --
> Lew
>






--
Ten-Blade

 
Reply With Quote
 
Rhino
Guest
Posts: n/a
 
      07-13-2011
http://www.velocityreviews.com/forums/(E-Mail Removed)-berlin.de (Stefan Ram) wrote in
news:(E-Mail Removed)-berlin.de:

> Ten Blade <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
No more stuff on C:\Documents and Settings\[User]\My Documents\Visual Studio 2005\ craigkenisston@hotmail.com ASP .Net 1 10-18-2006 03:31 PM
Jakarta POI to generate MS Word documents mlv2312@terra.com.br Java 2 02-16-2005 08:39 PM
Re: Module to generate OpenOffice Writer documents python Python 2 09-20-2003 02:45 PM
Module to generate OpenOffice Writer documents Ellinghaus, Lance Python 2 09-18-2003 04:31 AM



Advertisments