I have a dozen essays as PDFs which I want to combine to one concatenated master PDF with a table of content where each entry is a clickable link to the first page of each essay. The TOC could be either a page with internal links or a proper PDF TOC.
The best would be a command line solution on Linux and macOS. So far I have used QPDF, which works great for concatenating the essay PDFs, but it does not build a TOC.
It is a one-off problem, so I am happy to write some (bash, Python or other) scripting code to generate this TOC. For utility it is important that the links are clickable.
Any idea how to do this?