I was recently trying to add bookmarks to a PDF I'd generated with
pdftk. It turns out to be fairly simple to add bookmarks to a PDF
using Ghostscript, following maggoteer's post to the
Ubuntu forums. The syntax is:

I've bundled the whole pdfmarks-generation bit into a script,
pdf-merge.py, which generates the pdfmark file and runs
Ghostscript automatically. Think of it as a bookmark-preserving
version of pdftk's cat. The script uses pdftk internally to
extract bookmark information from the source PDFs.

The script also adds a bit of PostScript to ignore any bookmarks in
the source PDFs during the Ghostscript run. The only bookmarks in the
output will be the ones you specify explicitly in the pdfmarks file.
If for some reason the automatically generated pdfmarks are not quite
what you want, the script can pause (via --ask) to allow you to
tweak the pdfmarks manually before running Ghostscript.