TabGarden

Guides

What Merging PDFs Keeps and Loses: Bookmarks, Metadata, Forms and Links Tested

We built PDFs with metadata, bookmarks, forms, notes, links and attachments, merged them by copying pages, and checked what survived.

Merging PDFs sounds like stapling: put file A in front of file B and you are done. Inside the file, it is more like moving house. Each page and everything attached to it is packed and carried into a new document. Anything that belonged to the old document as a whole, rather than to a page, stays behind unless the tool makes a special effort to bring it.

TabGarden's Merge PDF and Split PDF tools both work by copying pages into a new, empty document with the open-source library pdf-lib. To find out exactly what survives that, we built two test PDFs packed with features, merged them with the same steps the tool uses, and inspected the result with four PDF libraries and tools. This guide reports what we saw and what we could not test.

Pages versus documents

A PDF has two levels:

Copying pages brings everything on the first list, because it is part of the page. The second list stays behind, because nothing in the page points to it.

How we tested

Source A (3 pages) was given:

Source B (2 pages) had a title, an author and its own text field, also called name, set to "Grace".

We merged A then B with exactly the calls the Merge PDF tool makes (create an empty document, copy all pages of each file, add them, save), and separately extracted pages 2 and 3 of A the way Split PDF does. The pdf-lib file used is byte-for-byte the one the site ships. We inspected every file with pdf-lib 1.17.1, pdf.js 4.10.38, pypdf 6.17.0 and poppler's pdfinfo 22.02. The scripts and the raw observations (CSV) are in the site's research/what-merging-pdfs-keeps-and-loses/ folder.

What survived

What was lost

The surprising one: internal links

A's page 1 had a link that jumped to page 3. After merging, the link was still on page 1, but its target had changed:

The reason is that a link stores a pointer to a specific page object. When the page with the link was copied, pdf-lib also copied the page it pointed to, as a hidden extra object that is not part of the page list. The merged file contained 8 page objects for 5 visible pages.

That hidden copy can cost space. We made a 3-page source in which every page held its own 2.0 MB photo, and added a link from page 1 to page 3. Sizes here use 1 MB = 1,048,576 bytes. Results:

If a split or extracted file is unexpectedly large, a table of contents or "see page X" links on the extracted pages are a likely cause.

Digital signatures: what we could and could not test

We could not test a PDF with a real cryptographic signature, because we had no certificate-signed test file made with signing software. What we did test was an empty signature field. Its box was copied onto page 3 of the merged file, still empty, and like the other fields it was no longer part of any form.

What follows from that is limited but clear: the merged file is a brand-new file written by pdf-lib, the form that holds signature fields is not copied, and the original file's bytes are not reproduced. So a merged copy cannot carry over a valid signature. If a signature must stay verifiable, send the signed file as it is, and if several documents need to be signed together, merge them first and sign the merged file.

What we did not test

Practical advice

Splitting works the same way

Split PDF uses the same page copying, so everything above applies to it too. In our test, extracting pages 2 and 3 of A kept the sticky note, highlight, web link and the 90 degree rotation, and lost the metadata, bookmarks, labels, attachment and form.

Common questions

Does merging reduce quality?

No. Pages are copied, not redrawn, so images are not recompressed and text stays text. File size changes are about what is copied, as the internal link example shows. For what drives the size of scanned pages, see scan documents to PDF with phone photos.

Are my files uploaded when I merge?

Not with the TabGarden tools: the copying runs in your browser tab. The guide on online file converters and privacy explains how to check this for any site.

Can I keep bookmarks when merging?

Not with page copying alone. A tool would have to rebuild the outline and point each entry at the copied pages. TabGarden's merge does not do that today, so plan to add them again afterwards if you need them.