Joins two or more PDFs into a single document and hands it to your browser as a download. Each selected file is read into an ArrayBuffer in the page, pdf-lib copies every page of every file in the order the picker returned them, and the combined document is saved as merged.pdf through a temporary blob URL. The files are already local to the tab, and the merge never sends their bytes anywhere.
How to use it
- Click the file control and select two or more PDFs at once - multiple selection is enabled.
- Press Merge PDFs. The button stays disabled until at least two files are listed.
- The browser saves merged.pdf, and the page reports how many files went in.
Worked example
two files: a 1-page 200x200pt PDF and a 2-page 300x300pt PDFbecomesMerged 2 PDFs successfullyVerified by running pdf-lib's copyPages path over two generated PDFs: the saved file reloads as 3 pages and each page keeps its own dimensions.
one file selectedbecomesSelect 2+ PDFs to mergeThis replaces the result line as soon as a single file is chosen; the Merge button is disabled at the same time, so the button's own 'Add at least 2 PDF files to merge.' text is only reachable if the list is emptied another way.
When to use it
- Combining a cover sheet with scanned pages so a client gets one file.
- Stitching monthly statements together for an accountant.
- Assembling a report from separate chapter exports without installing a desktop editor or handing confidential documents to an online service.
What it does not do
- The title promises more than the page does: there is no splitting, page rotation, reordering, compression or text extraction.
- Encrypted PDFs fail. pdf-lib's load rejects them unless ignoreEncryption is set, the page prints the library message prefixed with 'Error: ' and no file is produced.
- Interactive structure is dropped. A source PDF carrying one AcroForm text field merges into a document whose form reports zero fields - page content transfers, form fields and outlines do not.
- The download is always called merged.pdf, so a second merge may save as merged (1).pdf or overwrite the earlier file depending on your browser's duplicate-name setting.
- Every selected file is held in memory at the same time, which is fine for a handful of reports and unpleasant for a folder of large scans.