如何使用 java 打开 .doc 或 .docx 文件并检查文本格式

How to open .doc or .docx file and check text format using java

我想通过java打开一个.doc(或.docx)文件并检查文本某部分的字体系列、文本某部分的字体大小、表格和表格描述,右缩进、左缩进等(像这张图片)

在 java 中是否有用于此的任何库和 .jar 文件?我怎样才能将它用于我的目的?

你可以看看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