Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / January 2006

Tip: Looking for answers? Try searching our database.

How to convert Doc, XLS to PDF using Java API

Thread view: 
Ravi Velamuri - 26 Jan 2006 14:40 GMT
Hi.

How to convert DOC, XLS files into PDF using Java API. Plz advice if
any already worked on this kind of. Thx.
Best
Ravi.
Rhino - 26 Jan 2006 16:05 GMT
> Hi.
>
> How to convert DOC, XLS files into PDF using Java API. Plz advice if
> any already worked on this kind of. Thx.
> Best
> Ravi.

There is a project, POI, to read and write DOC and XLS files with Java.
There is also an existing package, iText, to write _new_ PDFs with Java.
However, I'm not aware of any way to _CONVERT_ DOC or XLS files to PDF
directly. Naturally, that doesn't mean that there is no way to convert them,
just that I don't know of any such tool.

You can find the POI project here: http://jakarta.apache.org/poi/. You'll
find that the ability to write XLS files is apparently fairly mature but
that the ability to write DOC files is still fairly primitive.

You can find the iText project here: http://www.lowagie.com/iText/.

Perhaps you could use POI to read your DOC and XLS files into a Java
program, extracting the relevant pieces of text, then writing them out again
in PDF format. I've never used POI, even for the most trivial of documents,
but I have been quite happy with iText so this approach _might_ work if POI
will co-operate.....

---
Rhino
Oliver Wong - 26 Jan 2006 16:25 GMT
>> Hi.
>>
[quoted text clipped - 20 lines]
> documents, but I have been quite happy with iText so this approach _might_
> work if POI will co-operate.....

   I believe POI was used on a project in which I was involved (though I
did not directly use POI itself). From what I could see, POI would only give
you a logical view of the data, and, i.e. not a physical view. For example,
you could get the contents of cell (3:2), but there was no direct facility
for determining how wide the resulting string would be should you draw it
onto some surface, for example. I guess you could, though, extract the font
the value was written in, since that kind of info seems to be persisted by
Microsoft Excel.

   So you MAY need to write a rendering engine in between POI and iText.

   - Oliver
pachi - 26 Jan 2006 16:41 GMT
Try http://www.gohtm.com/ The have a SDK for it

> > Hi.
> >
[quoted text clipped - 23 lines]
> ---
> Rhino
William Brogden - 28 Jan 2006 18:21 GMT
> Hi.
>
> How to convert DOC, XLS files into PDF using Java API. Plz advice if
> any already worked on this kind of. Thx.
> Best
> Ravi.

If you can get the data out of the DOC files,
the Apache FOP project can convert XSL-FO documents to PDF

http://xmlgraphics.apache.org/fop/

Signature

Using Opera's revolutionary e-mail client: http://www.opera.com/m2/

Ravi Velamuri - 30 Jan 2006 18:15 GMT
May be i can put more clarity on the content that I am trying to
convert into PDF "my doc file will have text and images also".
if not using POI, any  better idea..?Thx always.
-Ravi
Ravi Velamuri - 30 Jan 2006 18:15 GMT
May be i can put more clarity on the content that I am trying to
convert into PDF "my doc file will have text and images also".
if not using POI, any  better idea..?Thx always.
-Ravi


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.