1

I want to open a .doc (or .docx) file by java and check font-family of some part of text, font-size of some part of text, tables and description of tables, right indent, left indent etc.(like this image)

enter image description here

Is there any library and .jar file for this in java? How can I use it for my purpose?

Atefeh Rashidi
  • 485
  • 1
  • 8
  • 32
  • Possible duplicate of [What's a good Java API for creating Word documents?](http://stackoverflow.com/questions/203174/whats-a-good-java-api-for-creating-word-documents) – MordechayS Nov 10 '16 at 07:03
  • I want to open file and check format of text and right indent and left indent and tables. Aspose.word and docx4j do this?@MordechayS – Atefeh Rashidi Nov 10 '16 at 07:20

1 Answers1

1

You can take a look at Apache POI. It is a powerful library for creating and editing microsoft office documents. But if you need only to check some parameters in doc or docx you can use docx4j

D. Krauchanka
  • 264
  • 3
  • 15
  • I want to open file and check format of text and right indent and left indent and tables etc. Does it do this?@D. Krauchanka – Atefeh Rashidi Nov 10 '16 at 07:21
  • If you just want to verify some parameters of your document you can use docx4j instead of apache poi. It converts doc or docx to xml and then you can get all properties that you need – D. Krauchanka Nov 10 '16 at 07:37
  • Here is the example of how this xml looks like [link] (http://stackoverflow.com/questions/31234497/getting-text-style-from-docx-using-apache-poi), and here is how you can get indents [link](http://www.docx4java.org/forums/docx-java-f6/how-to-set-page-margins-t1163.html) – D. Krauchanka Nov 10 '16 at 07:39
  • format of tables and description of tables, right indent, left indent is more important. Which one (docx4j, Aspose.word, Apache POI) is better?@D. Krauchanka – Atefeh Rashidi Nov 10 '16 at 07:47
  • in my opinion, docx4j will be better in your case, because doc and docx formats are encoded xml, and docx4j can just decode this xml and there will be all parameters that were stored by microsoft word – D. Krauchanka Nov 10 '16 at 07:50