Where is the end of the humain?

记录-9-9

在转PDF中去除endnotes

使用Docx4j将word转pdf中,endnotes会自动生成在文件末尾,虽然在word原文件中是完全空白的,但是pdf依然会生成没有内容的大大的Endnotes标题。Java中可以在word中进行预处理去除endnotes的部分。

1
2
3
4
5
6
7
EndnotesPart endnotesPart = wordMLP.getMainDocumentPart().getEndNotesPart();
endnotesPart.remove();

//测试
MainDocumentPart mainDocumentPart = mock(MainDocumentPart.class);
doReturn(mainDocumentPart).when(wordMLP).getMainDocumentPart();
doReturn(new EndnotesPart()).when(mainDocumentPart).getEndNotesPart();

SQL custom order by

1
2
3
4
5
6
order by 
case
when type = 'apple' then 1
when type = 'banana' then 3
else 2
end desc

© 2026 iattachの小站

Elegant theme by Shiro · Made by Acris with ❤️