Merge PDFs without losing bookmarks, links, or form fields

Naive PDF merging strips bookmarks and breaks internal links. Here's what to look for in a merger that preserves them.

HuggingPDF··3 min read

Merging PDFs sounds simple: glue file A onto file B, get A+B. But anyone who's tried to combine a 200-page report with its appendix has discovered the cruel reality — bookmarks vanish, internal hyperlinks now point to the wrong pages, and form fields get duplicated names that break interactivity.

This guide explains why naive merging breaks these features and what a good merger does differently.

What "merging" actually does internally

A PDF file isn't a linear stream of pages. It's a tree of objects: page dictionaries, font resources, image streams, annotation objects, form-field definitions, a bookmark outline, and a cross-reference table that ties them together. Pages reference shared resources by ID.

When you merge two PDFs, you have to:

  1. Renumber every object in the second PDF so its IDs don't collide with the first.
  2. Rewrite all internal references (page → resource, link → destination, bookmark → page) to use the new IDs.
  3. Merge the resource dictionaries without duplicating embedded fonts or images.
  4. Stitch the outlines so the second PDF's bookmark tree appears under or after the first's.
  5. Rename conflicting form field names while preserving their bindings.
  6. Reconcile metadata (title, author, language).

Doing all six correctly is hard. Doing just step 1-2 gets you a PDF that opens, looks right at a glance, and is silently broken.

What naive merging breaks

Bookmarks (the table of contents in the sidebar)

In a naive merge, the bookmark outline from the second file is dropped entirely. You're left with only the first file's bookmarks. For a report being merged with an appendix, this means the appendix sections become unreachable from the sidebar.

A correct merger appends the second file's outline as a subtree, optionally under a parent bookmark you specify.

Internal hyperlinks

If file A has "See page 47" linking to page 47 of A, that link is still correct after merging — page 47 is still page 47. But if you merge B onto the front of A, page 47 of the combined PDF is now from B, not A. The link silently goes to the wrong page.

A correct merger rewrites every internal link's destination to point at the new absolute page number.

Form fields

PDF form fields are identified by name. If file A and file B both have a field named "signature", after merging you have two fields with the same name. Adobe Acrobat treats them as a single field — typing in one fills both. A correct merger renames duplicates (e.g. signature_2).

Embedded fonts

Both files probably embed the same fonts (Times, Helvetica). A naive merger embeds two copies, doubling the font portion of the file size. A correct merger deduplicates font streams.

How to merge without breaking things

The Merge PDF tool handles all six steps correctly:

  • Bookmarks from each input file are nested under a top-level entry with the file's name.
  • Internal links are rewritten to absolute destinations in the combined document.
  • Form-field names are auto-suffixed when collisions occur.
  • Fonts and images are deduplicated by content hash.

You don't need to do anything different on the user side — drop files in, reorder if needed, click Merge. The complexity is in the implementation.

What to verify after merging

Open the merged PDF in Adobe Reader (not just Preview on macOS, which silently glosses over many issues) and check:

  1. Sidebar bookmarks — every section from every input file is present and clickable.
  2. A few internal links — click "See page X" references and confirm they land on the right page.
  3. Form fields — if either input had fillable fields, tab through them and make sure typing in one doesn't fill another.
  4. File size — should be roughly the sum of inputs minus shared resources. If your merged file is much larger than expected, font deduplication probably failed.

When merging is the wrong tool

If your goal is "stamp file B as additional pages onto file A while keeping A's exact layout and bookmarks", merge is right. If your goal is "extract pages 10-15 from A and pages 1-3 from B into a new doc", use Split PDF first to extract the ranges, then merge the extracts.

Don't try to do both in one step — it's much easier to debug a wrong-page issue when you can verify each intermediate file independently.

Try the tool

Merge PDF

Combine multiple PDF files into one document online.

Open Merge PDF