原始文档 test.docx (35.0 KB)
ParagraphCollection paragraphs = headersFooter.getParagraphs();
for (Paragraph paragraph : paragraphs)
{
if (StringUtils.isNotBlank(paragraph.getText()))
{
ParagraphFormat paragraphFormat = paragraph.getParagraphFormat();
TabStopCollection tabStops = paragraphFormat.getTabStops();
int count = tabStops.getCount();
for (int i = 0; i < tabStops.getCount(); i++)
{
TabStop tabStop = tabStops.get(i);
double position = tabStop.getPosition();
int alignment = tabStop.getAlignment();
}
}
原始文档中,页眉的段落是有制表符的,但是使用上述代码获取到的count为0?