Skip to content
LeedyBox
Support

How to Merge PDF Files

Joining PDFs takes only a few clicks, but file order, page sizes and the parts of a PDF that sit outside its pages decide whether the result is easy to use. This guide covers how the LeedyBox Merge PDF tool works, what carries over and how to check the result.

Which Tool for Which Job

Merging puts whole documents one after another, such as a report and its appendices. For only some pages, or pages from several files mixed together, another tool fits better:

Goal Tool How
Join complete documents end to end Merge PDF Every page of each file, in list order
Use only a page range from a long file Split PDF, then Merge PDF "Custom Range Extraction" saves pages such as 2-4 as one file
Mix single pages from two files Organize PDF "Add pages from another PDF", then move or delete single pages
Add photos or scans JPG to PDF, then Merge PDF Images have to become PDF pages first

What the Merge PDF Tool Does

The tool runs in your browser. When you add a file, the PDF.js library counts its pages and draws a small preview of the first page. When you merge, the pdf-lib library copies every page of every file, in list order, into a new PDF. Pages are not redrawn as images: text stays selectable, images are not compressed again, and each page keeps its own size and rotation setting.

Because two different libraries read your files, a file can appear in the list with its preview and still fail when you merge; the problems section below explains when that happens.

The tool works with whole files: it has no page selection, and you can add the same file more than once. The code sets no maximum number of files and no file size limit; the FAQ below explains what limits a merge in practice.

Step by Step

  1. Open Merge PDF and click the box "Choose PDF Files or Drag & Drop Here", or drop files on it. In the file picker you can select several PDFs at once.
  2. While the files are read, a progress bar and a counter such as "Loading PDF 1 / 3..." appear. When all of them have been read, each file is listed under "Selected PDFs" with a preview of its first page, its name and its page count.
  3. Arrange the list from top to bottom. The arrow buttons move a file up or down one place, the × button removes it and "Clear All" empties the list without asking for confirmation. There is no undo, so a removed file has to be added again. Files you add later go to the end. Within one selection the browser sets the starting order, which may not follow the file names, so check it.
  4. Click "Merge PDF Files & Download". The button shows "Merging PDFs..." while it works, and the result is downloaded as merged_document.pdf. Rename it before you send it.

Plan Where Each Document Starts

Bookmarks do not carry over (see below), so readers find sections by page number. Each file starts one page after the total of all files above it in the list. With a 12-page report, a 4-page scanned appendix and a 7-page letter, the merged file has 12 + 4 + 7 = 23 pages. The appendix starts on page 13 and the letter on page 12 + 4 + 1 = 17. The page counts in the list let you work this out for a cover note or contents page.

For double-sided printing, a document that should start on the front of a sheet needs an odd page number. Here that works because 12 and 4 are even. If the appendix had 5 pages, the letter would start on page 18, on the back of the appendix's last sheet. To fix that, open the merged file in Organize PDF and click the blank-page button under page 17 (its tooltip reads "Insert a blank page after page 17"). The new page gets the size of page 17, and the letter then starts on page 19. See How to Reorder, Rotate and Delete PDF Pages.

Mixed Page Sizes and Orientation

The tool does not resize pages to a common format. Documents from the United States and Canada usually use US Letter (215.9 × 279.4 mm), while most other countries use A4 (210 × 297 mm), and in the merged file each page keeps its size. Printing on one paper size with "fit to page" or a similar option scales the others: a Letter page on A4 paper is reduced to about 97% (210 ÷ 215.9) and leaves roughly 25 mm of the sheet's height empty, and an A4 page on Letter paper is reduced to about 94% (279.4 ÷ 297). Printer margins can reduce the scale a little more, so check small print in the print preview.

Landscape pages stay landscape. A page that is sideways in the merged file was already shown that way in its source; turn it with Rotate PDF.

What Carries Over and What Does Not

The tool copies pages only, while bookmarks, page labels, forms and document details belong to the whole file. We checked this by running the tool's merge code (pdf-lib 1.17.1, the version the page loads) in Node.js on test files made with ReportLab and pypdf:

Part of the PDF In the merged file
Text, images and drawings Copied as they are
Page size and rotation Kept for each page
Comments, highlights and web links Copied with their page
Links to other pages of the same document Likely to stop working: in the test they no longer pointed to a page of the merged file
Form fields Filled-in values stayed visible, but the merged file had no form definition, so PDF viewers may not treat the fields as editable
Bookmarks, page labels (such as i, ii, 1, 2), files attached to the whole document Not copied; pages are numbered 1 to the last page
Title and author Not copied; the document properties list pdf-lib as the producer and creator, and viewers may show the file name as the title

If a form still needs to be filled in, fill it before merging, or send it as a separate file. Digital signatures were not part of the test, but a signature is tied to the bytes of the file as it was signed, and the merged file is written from scratch, so do not expect a signature to stay valid. Send the signed original on its own.

How Large the Merged File Will Be

Expect roughly the total of the inputs. In the same test, a 12-page text file (13.3 KB), a 4-page file of scan-like JPEG page images (3.76 MB) and a 7-page Letter file (6.3 KB) gave a 23-page file of 3.77 MB, slightly less than their 3.78 MB total (1 KB = 1,000 bytes, 1 MB = 1,000,000 bytes). Images make up most of that, and they are copied byte for byte. Small text files can change more in relative terms, because pdf-lib writes the file structure anew: the text file run through the tool on its own came out at 7.8 KB. Adding the scan twice gave 7.53 MB, because the tool does not look for content that two files share, so it is stored twice.

If the result is too large for an upload limit, shrink the images before you build the PDFs, or run Compress PDF afterwards. It turns each page into a JPEG image, so text can no longer be selected or searched. It suits scans best; a file that is mostly text can even get larger. See How to Compress a PDF.

Common Problems and Fixes

  • "Failed to load PDF file" when adding a file. The file needs a password to open, is damaged or is not a real PDF despite its name. The file is left out of the list. If a PDF viewer asks for a password, ask the sender for an unprotected copy; the tool does not remove PDF protection.
  • "An error occurred while merging the PDF files." The most likely cause is a file that is encrypted although it opens without a password, for example because printing or editing is restricted. Such a file loads into the list with its preview, but the merge stops and nothing is downloaded. A damaged file that the preview could still read can cause the same error. Remove files one at a time to find it.
  • "… is not a PDF file." This usually appears when you drop another kind of file, such as a photo, on the box. The file is skipped; convert images with JPG to PDF first.
  • The page stops responding or the tab crashes. Usually the files need more memory than the device can give the tab. Each file you add stays open in the background for its preview, even after you remove it or click "Clear All", so after trying many large files, reload the page and add only the files you need. If it still fails, merge in batches.

Check the Merged File

  • The page count equals the sum of the counts shown in the list.
  • Each document starts on the page you planned, and none is missing or doubled.
  • Pages are upright, and text that could be selected in the originals still can be.
  • Links and forms you rely on still work.

Keep the original files until you have checked the result. To number the combined document, use Add Page Numbers; see Adding Page Numbers to a PDF.

Frequently Asked Questions

Can I merge only some pages of a file?

Not in Merge PDF, which adds every page. Extract the pages first with Split PDF (see the split guide), or open one file in Organize PDF, add the other with "Add pages from another PDF" and delete the pages you do not need.

Are my files uploaded?

No. Your files are read and joined in your browser and are not sent to a LeedyBox server. The page does need an internet connection, because it downloads the PDF.js and pdf-lib libraries from leedybox.com.

How many files can I merge at once?

The tool sets no maximum. During the merge, the pages of all files are copied into one new document in the browser's memory before it is saved, so many large files can make the page slow or fail, especially on a phone. If that happens, merge in batches and then merge the results.

Why does the preview in the list look blurry?

The preview is a small, low-resolution image of the first page, drawn only for the list. It is not used in the merged file, which contains the original pages; open the downloaded file to judge the quality.

Can I merge password-protected PDFs?

No. Files that need a password to open are refused when you add them. Files that open without a password but are encrypted to restrict printing or editing appear in the list, then stop the merge. Use unprotected copies.