When I use PYPDF2 to merge two PDF documents, I set the Page Mode to /UseOutlines so that the PDF will display the bookmark pane when the document is opened.
merger = PdfFileMerger()
merger.append(PdfFileReader(filename,'rb'),import_bookmarks=True)
merger.setPageMode('/UseOutlines')
merger.setPageLayout('/SinglePage')
However, whenever the PDF document is opened the bookmarks are always expanded. Is there a property that I can modify to force the bookmarks to be collapsed when the document is opened?