• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

convert word documents to PDF

 
Rajendar Goud
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I am running a web application on linux and need some conversion tools or mechanism for converting a word document to pdf format.

I had a look at apache fop,itext but these need the input inform of xml,meaning i had to manually input all the word document data into xml and then had to process the xml for pdf generation.
Is there a direct way to convert the word document into PDF for web application?

Its bit urgent.. thank you
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put your title into a google search box, your answers are there definitely!!!

Believe me or not, I did try before post this.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reading word files is general is tricky. The POI library can extract text from doc files, which could be used to create a PDF using iText.

An alternative would be to use the OpenOffice Java API to open the doc file and save it as PDF.

The AccessingFileFormats FAQ page has links to these (and other) libraries useful for dealing with various file formats.
 
Rajendar Goud
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the response. I have a doubt..

iText is used for handling editable PDF.
Does iText work similar to FOP?? i,e we need to pass the xml template along with the xsl style sheet which will be transformed or rendered into PDF generation using the iText library??
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
iText does not use XSL; it is a Java API for creating PDF documents. If you want it to handle XML files, then you have to read the XML in your code, and hand it to the API in appropriate chunks. The iText web site has plenty of examples of how it works in general, including an example of how to use XML as input.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic