This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes convert word documents to PDF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "convert word documents to PDF " Watch "convert word documents to PDF " New topic
Author

convert word documents to PDF

Rajendar Goud
Ranch Hand

Joined: Mar 06, 2002
Posts: 220
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

Joined: Nov 14, 2000
Posts: 1953
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
Marshal

Joined: Mar 22, 2005
Posts: 41089
    
  44
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.


Ping & DNS - my free Android networking tools app
Rajendar Goud
Ranch Hand

Joined: Mar 06, 2002
Posts: 220
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
Marshal

Joined: Mar 22, 2005
Posts: 41089
    
  44
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: convert word documents to PDF
 
Similar Threads
Convert Word document to XML
Java Api for converting Word document to PDF?
xml to pdf
Need a java code for convert PDF to Word document as well as Word document to XML. Is this possible
convert word documents to PDF