有人知道如何获取RTF文件的页眉/页脚吗?我尝试过这样的方法(使用RTfEditorKit):
RTFEditorKit rtf = new RTFEditorKit();
DefaultStyledDocument docIn = (DefaultStyledDocument) rtf.createDefaultDocument();
try {
FileInputStream fi = new FileInputStream("zf_static_follow.out.rtf");
rtf.read(fi, docIn, 0);
} catch (IOException e) {
e.printStackTrace();
} catch (BadLocationException e) {
e.printStackTrace();
}
docIn.getProperty("header");// <-- null
System.out.println(docIn.getProperty("headerf")); // <--null
System.out.println(docIn.getProperty("headerl")); // <--null
System.out.println(docIn.getProperty("headerr")); // <--null提前谢谢你的帮助。布尔马库斯
发布于 2013-11-27 13:53:58
使用public Dictionary<Object,Object> getDocumentProperties()方法的AbstractDocument并查看Document的所有现有属性。
https://stackoverflow.com/questions/20244214
复制相似问题