Saturday, February 19, 2011

How to get the page count of a microsoft word document in java?

Hi, for a server based j2ee application, I need to retrieve the number of pages from word documents.. any ideas what works?

From stackoverflow
  • If the documents are modern Word 2007 format you can use direct XML-based manipulation, through OOXML. This is by far the better long term solution, though I realize it may not be realistic for an entire organization to change overnight.

    If they are older Word formats, you're probably stuck with server-side Word/Excel/Powerpoint/Outlook programmable object models, although you're not supposed to do that on the server..

  • Regarding Office Open XML support, the latest beta of Java-POI is supposed to support it.

  • Haven't used it before but you could try Apache POI. Looks like it has a WordCount function.

0 comments:

Post a Comment