Hi Odf-Users,
I m new in Apache Foundation and in asking help in that type of process but I really don't know how to achieve what I want to do and I think I am in the good place to ask my question. I am generating a ODT document for a professionnal project. The problem is that I need to have a table of content with hyperlinks to paragraphs for each single part of my Table Of Content. This is not really complicated and I already achieved this. The problem is that when I want to load another ODT file in my master document, I don't know how to format my Table of Content well. I ended up having something like : " Table of Contents 1.This is a tmp paragraph<https://outlook.office.com/owa/?realm=epitech.eu&path=/mail/drafts#__RefHeading__7098_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>....<https://outlook.office.com/owa/#__RefHeading__7100_971365491>................... 1 Test1<https://outlook.office.com/owa/?realm=epitech.eu&path=/mail/drafts#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.......<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.............2 Test2<https://outlook.office.com/owa/?realm=epitech.eu&path=/mail/drafts#__RefHeading__7102_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>....................4 " instead of something like : " Table of Contents 1.This is a tmp paragraph<https://outlook.office.com/owa/#__RefHeading__7098_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>....<https://outlook.office.com/owa/#__RefHeading__7100_971365491>...................... 1 2.Test1<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.......<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.......2 3.Test2<https://outlook.office.com/owa/#__RefHeading__7102_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>.........<https://outlook.office.com/owa/#__RefHeading__7100_971365491>..............4 " My code is formated like this : TextDocument doc = TextDocument.newTextDocument(); Paragraph tmp = doc.addParagraph("1.This is a tmp paragraph"); tmp.applyHeading(); while (...) { TextDocument layout = TextDocument.loadDocument("./layout.odt"); // process modification in document before adding it to my main document } tmp.applyHeading(true, 2); doc.insertContentFromDocumentAfter(layout, tmp, true); ++i; } My problem is that I don't know how to format or access the strings ("Test1", "Test2"), pushed automatically with "insertContentFromDocumentAfter" method, into the table of content to format them. Thank you for giving me your time to help me on my problem,
