Ok, here is a quick'n'dirty way to do three jobs at once:
- Merge your 400 single-page PDFs.
- Create a document top level ToC (Table of Contents).
- Create a PDF bookmark for each page.
It involves using a LaTeX installation.
You start with an empty LaTeX template like the following one:
\documentclass[]{article}
\usepackage{pdfpages}
\usepackage{hyperref}
\hypersetup{breaklinks=true,
bookmarks=true,
pdfauthor={},
pdftitle={},
colorlinks=true,
citecolor=blue,
urlcolor=blue,
linkcolor=magenta,
pdfborder={0 0 0}}
\begin{document}
{
\hypersetup{linkcolor=black}
\setcounter{tocdepth}{3}
% Comment next line in or out if you want a ToC or not:
\tableofcontents
}
%% Here goes your additional code:
%% 1 line per included PDF!
\end{document}
Now just before the last line of this template, you insert one line per external PDF file you want to include.
In case you want to generate a ToC, it has to be formatted like this:
\includepdf[pages={<pagenumber>},addtotoc{<pagenumber>,<section>,<level>,\
<heading>,<label>}]{pdffilename.pdf}
In case you are sure that each and every included PDF is a 1-page document, it simplifies to this:
\includepdf[addtotoc{<pagenumber>,<section>,<level>,\
<heading>,<label>}]]{pdffilename.pdf}
Here all of the following five parameters for addtotoc
are required, in the order given for the files to appear in the bookmarks and in the ToC. See further below for a specific example:
<pagenumber>
: Number of the page of inserted document to be linked to. (In your case always "1", because you insert 1-page documents only; you could insert a 5-page document and link to page 3 of the inserted PDF, though).
<section>
: The LaTeX sectioning name. Could be section
, subsection
, subsubsection
... In your case "section".
<level>
: The level of the LaTeX section. In your case "1".
<heading>
: This is a string. Used for the text of the bookmark
<label>
: This must be unique for each bookmark. Used in the PDF internally to jump to correct page when bookmark is clicked.
To test this quickly, I used Ghostscript to generate 20 1-page PDF documents:
for i in {1..20}; do
gs -o p${i}.pdf -sDEVICE=pdfwrite \
-c "/Helvetica findfont 30 scalefont setfont \
100 600 moveto \
(Page ${i}) show \
showpage";
done
With these test files I could make the lines to insert into the template look like these:
\includepdf[addtotoc={1,section,1,Page 1 (First),p1}]{p1.pdf}
\includepdf[addtotoc={1,section,1,Page 2,p2}]{p2.pdf}
\includepdf[addtotoc={1,section,1,Page 3,p3}]{p3.pdf}
[...]
\includepdf[addtotoc={1,section,1,Page 11 (In the Middle),p11}]{p11.pdf}
[...]
\includepdf[addtotoc={1,section,1,Page 20 (Last),p20}]{p20.pdf}
Save the template with the inserted lines, then run the following command twice:
pdflatex template.tex
pdflatex template.tex
The resulting file will have the bookmarks, looking like this in Preview.app:

Note: LaTeX is available for OSX via two methods:
I'll add one or two other methods to insert bookmarks on the command line too, later or in the next few days, if I have more time.
For now this one has to do, because I never showed it here on SO, AFAICR.
But I thought because you gave the background "I'm merging 1-page PDFs, and it is slow; now I want to add bookmarks too...", I could show how to do it with one single method.
HINT : One of the other methods will be to use pdftk
which IS available for Mac OS X!
pdftk
-vendor, not from some rubbish third party provider)...