I recently found in this answer that it's fairly simple to edit the code in a PDF document, using a text editor, to alter how page numbers are displayed in a viewer. This solved a key problem for me.
Given that, I've been trying to find a way to similarly edit the bookmarks coded into a PDF document. Unfortunately, I can't find any promising object tags in a document with bookmarks, and I haven't been able to find information about that here or elsewhere online.
What is the format for bookmarks encoded in a PDF document?
Is it possible to edit them directly with a text editor, and if so, how?
Note that the question currently marked as a duplicate is not the same as the present question. This question is asking about the internal format and possibility of manually editing a PDF encoded file; none of the answers on that other question address this (all answers point to using outside automated tools).