You can extract the required set of pages using extract method of PdfFileEditor class by passing the pages you want to extract as integer array. This way you can create 5 new PDF files of 2 pages each.
However, I’m afraid, it is not feasible to split the bookmarks along with the files. You’ll have to create the new bookmarks for the newly created PDF files.
I hope this helps. If you find any further questions, please do let us know. Regards,
I have reproduced this problem at my end and logged it as PDFKITJAVA-30395 in our issue tracking system. Our team will look into this issue and you’ll be updated via this forum thread once it is resolved.