• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Api for converting Word document to PDF?

 
Praveen Garimella
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
Detlev Beutner
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • 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
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic