• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Java Api for converting Word document to PDF?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm looking for a java api or open source components which can convert a word document into a PDF. I have an application where the users upload word documents and the upload servlet should be able to convert this word document into PDF.
Any one out there to help me out!
Praveen
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know any single library but you can use the POI library to read Office file formats and then use the iText library to transform your data into PDF.
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Praveen,
like Gregg, I also don't know of such a library, and in addition, I do not believe that such a library exists. If you want the Word-doc directly converted into PDF, with the same layout, in fact you want to "print" the document to a PDF-destiller, PDF-Writer or such a thing.
A possibility could be to use OpenOffice; it has got Java-API's, and it's more secure than POI, which in fact is a bit alpha... Nevertheless, the OpenOffice Java API's are a bit confusing to handle with. There are some examples given, with these it is quite easy to convert for example .doc to .txt (and then using a PDF-Library). But again, that's not what you want, as far as I have understood.
Maybe the OpenOffice forums are a good place to ask some people there if the API's offer the possibility to "print" programmatically (to a destiller or such thing).
Hope it helps
Detlev
[ October 20, 2003: Message edited by: Detlev Beutner ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, if you choose to go the OpenOffice route, Oo1.1 has a PDF converter built in. So you don't have to mess with all the API stuff. Just click the PDF button on the tool bar, and it will prompt you to where you want to save the file as a PDF.
However, if you need to go the JAVA route programatically, then my option is the easiest one in my opinion.
 
Hey, I'm supposed to be the guide! Wait up! No fair! You have the tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic