• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

convert word documents to PDF

 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
What a stench! Central nervous system shutting down. Save yourself tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic