{"action":"opened","issue":{"url":"https://api.github.com/repos/TomRoush/PdfBox-Android/issues/56","labels_url":"https://api.github.com/repos/TomRoush/PdfBox-Android/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/TomRoush/PdfBox-Android/issues/56/comments","events_url":"https://api.github.com/repos/TomRoush/PdfBox-Android/issues/56/events","html_url":"https://github.com/TomRoush/PdfBox-Android/issues/56","id":109591744,"number":56,"title":"Bug in PDFMergerUtility (with FIX)","user":{"login":"madcyph3r","id":6138180,"avatar_url":"https://avatars.githubusercontent.com/u/6138180?v=3","gravatar_id":"","url":"https://api.github.com/users/madcyph3r","html_url":"https://github.com/madcyph3r","followers_url":"https://api.github.com/users/madcyph3r/followers","following_url":"https://api.github.com/users/madcyph3r/following{/other_user}","gists_url":"https://api.github.com/users/madcyph3r/gists{/gist_id}","starred_url":"https://api.github.com/users/madcyph3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madcyph3r/subscriptions","organizations_url":"https://api.github.com/users/madcyph3r/orgs","repos_url":"https://api.github.com/users/madcyph3r/repos","events_url":"https://api.github.com/users/madcyph3r/events{/privacy}","received_events_url":"https://api.github.com/users/madcyph3r/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-03T00:02:22Z","updated_at":"2015-10-03T00:02:22Z","closed_at":null,"body":"If i merge to pdf files with sublings, i the exception \"A single node with no siblings is required\".\r\n\r\nTo fix this bug, replace the lines 210 until 214 in the PDFMergerUtility.java with the following code:\r\n\r\n```java\r\nfor (PDOutlineItem item : srcOutline.children()) {\r\n                            // get each child, clone its dictionary, remove siblings info,\r\n                            // append outline item created from there\r\n                            COSDictionary clonedDict = (COSDictionary) cloner.cloneForNewDocument(item);\r\n                            clonedDict.removeItem(COSName.PREV);\r\n                            clonedDict.removeItem(COSName.NEXT);\r\n                            PDOutlineItem clonedItem = new PDOutlineItem(clonedDict);\r\n                            destOutline.addLast(clonedItem);\r\n}\r\n```\r\n\r\nThis code is from the official PdfBox Trunk and works fine. i have tested it."}}