Hi! I am trying to create a single pdf from a hierarchy of previously generated pdfs, and having some problems with the outline. I have two pdfs, one for the parent and one for its children, and want to add the existing outline of the children as the child of the existing outline for the parent.
My current code is // load pdfs here PDFMergerUtility pdfMergerUtility = new PDFMergerUtility(); pdfMergerUtility.appendDocument(pdf, attachment); PDDocumentOutline documentOutline = pdf.getDocumentCatalog().getDocumentOutline(); PDOutlineItem originalRoot = documentOutline.getFirstChild(); PDOutlineItem appendedRoot = originalRoot.getNextSibling(); originalRoot.appendChild(appendedRoot); //save pdf here The resulting pdf looks like it is supposed to and the outline is working, i.e. clicking on a node jumps to the correct page. But the children are duplicated, they show as both children and siblings of the outline from the parent pdf. In all my attempts that resulted in the outline looking like it should, clicking on the outline nodes had no effect. Any pointers? -- mvh, Marvin B. Lillehaug

