• 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 msword doc 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
How could i convert word doc to PDF ..
Please give any sample code to do so..
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not aware of a Java library that can do this in a generic way. There is POI (from Jakarta) which lets you read Word (and Excel) files, and there's iText (on SourceForge) which lets you create PDF files. With these you could stitch something together, but probably not a converter that works for each Word document.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Both formats are quite complex. Maybe a good solution in this case will be to find a pdf printer (software that installs a virtual printer) and print the doc files to it - the printer will create the PDF for you.

If there is an export option in your doc file editor you could look for a way to call it (via API or command-line option).

Another solution could be to open the doc file in OpenOffice, then export it as PDF, this can be done using the UNO API provided by OpenOffice.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic