누군가가 RTF 파일의 머리글/바닥 글을 얻는 방법을 알고 있습니까? RTfEditorKit을 사용하여 다음과 같이 시도했습니다. RTFEditorKit rtf = new RTFEditorKit();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
미리 도움을 주셔서 감사합니다. BR 마르쿠스
RTF에서 헤더를 가져올 수 있습니까? 아래의 대답은 그것을 분명히하지 않습니다. – Panthro