How Alternate & Mix two PDFs works
PDF Alternate Mix interleaves pages from two PDFs in strict alternating order: page 1 from document A, page 1 from document B, page 2 from A, page 2 from B, and so on. The result is a single merged PDF with pages in the sequence A1, B1, A2, B2. This is the operation you need after scanning a double-sided document on a single-sided scanner, where you scan all fronts in one pass and all backs in a second pass. pdf-lib assembles the interleaved document inside your browser, and neither file is sent to a server.
The tool also supports an optional reverse mode for the second document. When a single-sided scanner produces the back pages in reverse order (because the stack is flipped), enabling this option mirrors the back page sequence before interleaving, so page 1 front correctly pairs with page 1 back. For documents with an odd total page count, any leftover page from the longer file is appended at the end.