문제

does somebody know how to get the header / footer of a RTF file ? I tried something like this (using the 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

Thanks in advance for your help. br Markus

도움이 되었습니까?

해결책

Use public Dictionary<Object,Object> getDocumentProperties() method of AbstractDocument and see all existing properties of the Document.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top