← All posts

Fewer files than bookmarks? Here’s what happened.

You counted the bookmarks in the sidebar. Twenty. You split the file at its bookmarks and got seventeen PDFs back, and now you are opening each one trying to work out which three chapters have gone missing.

None of them. A split by bookmarks cannot lose pages, only cuts. Every page of the original is in exactly one of those seventeen files — three of the chapters just did not get a cut of their own, so they are sitting on the end of the file above them.

That is the reassuring half. The useful half is that the three that were skipped were skipped for a reason, the reason is usually visible in about a minute, and only one of the four causes announces itself in the result.

Why the count is what it is

The outline is a list of "this title, that page". Splitting at it means resolving each entry to a page number and cutting between consecutive starts: part one runs from the first cut to the page before the second, part two from the second to the page before the third, the last one runs to the end of the document. Nothing is deleted, nothing is duplicated, and the parts tile the original exactly.

So the number of files you get is not the number of bookmarks. It is:

the bookmarks at the level you chose, that resolve to a page, and that move forward — plus one more file if the first bookmark is not on page 1, because the cover and contents page in front of it have to go somewhere.

That extra front file is worth holding on to, because it hides things. Twenty bookmarks, one of them skipped, plus a cover file, comes to twenty files and looks like everything worked.

The one-minute check

Do this before you assume anything is broken.

  1. Add up the pages. Note the original's page count — our PDF inspector reads it out of the file in your browser without uploading anything — then add up the page counts of the parts. They must come to the same number. If they do, nothing has been lost and you are only deciding whether you want more files.
  2. Read the filenames. Split by bookmarks names each part after the bookmark that started it, so the list of filenames in the zip is the list of bookmarks that became cuts. Put it next to the sidebar and the missing names are the skipped ones.
  3. Open the file above each missing name. The chapter you thought you had lost is at the end of it. Confirm that once and the panic is over.
  4. Check which level you asked for. More on that below — it is the cause people hit most and the one that does not feel like a cause at all.

The four reasons a bookmark does not become a file

Two bookmarks on the same page. A destination is a page plus a position on it — top of the page, a scroll offset, a zoom. A file boundary has no position; it is a whole page or nothing. So when a chapter title and its first section heading sit on the same sheet, that sheet can only start one file. The first bookmark wins, names the part, and the second is dropped. This is rare at level 1 and extremely common at level 2, where headings crowd together on a page.

The bookmark points at nothing. An entry can reference its page in two ways: directly, or by a name that is looked up in a table of named destinations kept elsewhere in the file. Assembly tools of a certain age copy the outline and not that table, and the entry survives as a title with a dangling reference behind it. It cannot be resolved to a page, so it cannot be a cut point. This is the only one of the four that is counted for you: the result says how many bookmarks pointed at nothing and were skipped. It is the same failure that empties the sidebar when you merge PDFs, caught one step later. If a third of your bookmarks are being skipped this way, the outline is broken and worth rebuilding rather than working around.

The outline runs backwards. An outline is a tree in the order somebody wrote it, not a list sorted by page, and nothing in the format obliges the two to agree. A "Contents" entry added at the bottom of the list, an appendix bookmarked out of sequence, an outline edited by hand — any entry pointing at a page at or before the previous cut is skipped, because a part that ends before it starts is not a thing. Sort your sidebar entries by the page they jump to and any that go backwards are your answer.

You are counting a different level. This is the big one. The sidebar shows you every entry at every depth once you expand it; the split takes the bookmarks at exactly the level you asked for. Ask for level 2 on a manual where chapters 1 to 3 have sub-headings and chapters 4 and 5 do not, and you get files for the sub-headings only — chapters 4 and 5 contribute no cut at all, and their pages land at the end of the last section of chapter 3. Uneven outlines are normal and this is what they do. If the goal is one file per chapter, split at level 1 and split a part again if it is still too big; the level model is worth reading in full before you go deeper.

Two things that are not the cause

Identical chapter titles do not overwrite each other. If two bookmarks have the same title, or two long titles are identical for their first 80 characters, the second file is written as Title-2.pdf rather than replacing the first. A name collision never costs you a file.

A numbered file among the named ones is not a failure either. A bookmark with a blank title has nothing to name its part with, so it falls back to a numbered filename. The pages are all present; only the label is missing.

Getting the files you actually wanted

If the split was short because the outline is bad rather than because you picked the wrong level, there are two routes and they suit different files.

Run it through Repair PDF first if you want the count without doing the counting. It rebuilds the document and carries the outline across, and its notes say how many bookmarks it kept and how many of them point at pages that are no longer there. That is your broken-destination total for the whole tree in one line. What it will not do is resurrect a destination that resolves to nothing — a dangling reference stays dangling, it is simply now labelled. It also invalidates a digital signature, because the file is rebuilt from scratch.

When too much of the outline is broken, stop repairing it and replace it. Create PDF bookmarks throws away what is there and builds a fresh outline from the document's own headings, or from a pattern like Chapter \d+ that you type; how it decides what counts as a heading is set out with the rest of what it can and cannot do. Two of those limits decide what happens next here. The outline it builds is flat, one level only, so level 1 is the split you will be doing afterwards. And it needs a real text layer, which puts a scanned book out of reach until it has been through OCR somewhere else. Keep the original file either way: the bookmarks that were there go when the new outline arrives.

And if only two or three cuts are missing, do not rebuild anything. Note the page numbers where those chapters start and use Split PDF by pages, which cuts wherever you say. The parts come out numbered rather than named, which for three files is a rename and not a project.

What splitting at bookmarks will never do

Cuts land on page boundaries. A chapter that begins halfway down a page cannot be split off cleanly by any tool that works on whole pages, which is all of them. If your source document is still around, put a page break in front of each chapter there and re-export.

The parts carry no outline of their own, sub-headings and all. That follows from where an outline lives rather than from any setting you could change, and splitting a book into chapters covers it. Run each part through Create PDF bookmarks if they need to be navigable.

A ceiling of 5,000 bookmarks applies, and an outline that loops back on itself is stopped at the repeat rather than followed round forever. Both are signs of a generated or damaged file rather than a normal one.

Diagnosing it from the command line

If you want the whole outline as a table — titles, levels and page numbers together — this is faster than expanding a sidebar, and all of it is free:

Whatever you do, check the page counts add up before you go looking for lost chapters. Seventeen files from twenty bookmarks is nearly always seventeen files containing twenty chapters.