Combine several PDFs into one document without handing them to a server. Add the files in any order, rearrange them, and check the result in an editor before you download it.
Every page keeps its own size
Merging tools often force every page onto the size of the first document, which turns a landscape chart into a stretched or letterboxed mess. Here each page is written with the dimensions it had in its source file, so a mixed stack of A4 portrait, A4 landscape, and A3 comes out with all three intact.
Reorder before you commit
Files are listed in the order you add them, with a page count beside each one. Move them up or down, or drop one you added by mistake. Nothing is combined until you press Merge, and the result opens in the editor where you can still delete or reorder individual pages.
What this does not preserve
The merge runs through a design schema rather than at the byte level. Text, images, and vector artwork survive. Interactive form fields, bookmarks, annotations, and internal links do not. If your documents carry any of those and you need them intact, a byte-level library such as pdf-lib is the right tool and this one is not.
The same operation in code
import { pdfToJson } from "@polotno/pdf-import";
import { jsonToPDFBlob } from "@polotno/pdf-export/browser";
const designs = await Promise.all(
files.map(async (file) => pdfToJson({ pdf: await file.arrayBuffer() })),
);
// Concatenate pages, pinning each to the size it had in its source doc.
const merged = {
...designs[0],
pages: designs.flatMap((design) =>
design.pages.map((page) => ({
...page,
width: typeof page.width === "number" ? page.width : design.width,
height: typeof page.height === "number" ? page.height : design.height,
})),
),
};
const blob = await jsonToPDFBlob(merged);A page whose size is "auto" inherits its owndocument's dimensions, so it has to be pinned before the pages move into a shared design. See PDF import, PDF export, and PDF editing in the SDK.
