我想知道如何获取 docx4j 中的页码
我的问题是,我创建了一个表格,并且必须删除某些行之间的一些边框,但这使得表格在分页符之前没有底部边框
所以我需要有关页码的信息才能执行类似的操作
if(currentElementPageNumber != precedentElementPageNumber)
ctBorderTop.setVal(STBorder.Double);
tcBorder.setTop(ctBorderBottom);
tcpr2.setTcBorders(tcBorder);
或者一种检测分页符的方法,任何想法都会有帮助
最佳答案
您可以添加书签,然后将其发送到商业 PDF 转换器以获取 JSON 格式的信息。请参阅https://github.com/plutext/docx4j/blob/master/src/main/java/org/docx4j/toc/TocGenerator.java#L763得到一个想法
另请参阅Conditional Formatting in Microsoft Word 2016 Table Cells对于其他想法
关于java - docx4j 中的页码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50118585/