Skip to content

Alternate and mix PDF pages

Combine files page by page, one from each in turn.

Drop PDFs here

Only your browser reads them.

How to use Alternate & mix

  1. Add your PDFs in order. Drop at least 2 PDF files into the workspace, placing the front-side scan first and the back-side scan last.
  2. Check the reverse toggle. Keep Reverse the last file ticked if you flipped the paper stack in a single-sided scanner, or untick it if both files are already forward-ordered.
  3. Mix and download. Click Mix files to interleave every page locally and save the combined <name>-mixed.pdf file.

Your files are processed on this device and never uploaded. They stay private, and there's nothing to delete afterwards.

How do you combine and interleave front and back scans into one PDF?

Drop your front-side scan first and your back-side scan second, keep Reverse the last file checked, and click Mix files to assemble pages 1, 2, 3 in reading order. Simplex document feeders scan front sides 1 through N, leaving the paper stack inverted so the second pass captures back sides N down to 1.

Using this browser duplex scan collator copies each source file’s pages in one batch so shared fonts and embedded images are referenced once under the Library of Congress PDF 1.7 (ISO 32000-1) specification. Afterward, you can inspect and drag individual pages into final order if a feeder mis-pulled a sheet.

Why Reverse the last file is ticked by default

Because 90% of duplex-by-hand scanning workflows invert the second pass, Reverse the last file starts checked. When mixing two forward-ordered files, such as English and French slide decks, untick the checkbox before clicking Mix files.

Preserving OCR text and shared fonts across interleaved pages

Instead of rendering pages into flat bitmaps, @cantoo/pdf-lib transfers native PDF page dictionaries directly into the new document. Searchable OCR layers, form fields, and vector line art remain crisp and selectable.

Because copyPages() runs once per source file rather than once per page, embedded font subsets and background watermarks are not duplicated across every sheet. That keeps multi-hundred-page duplex scans compact enough for email attachments and archival folders.

Comparing alternate mix vs merge PDF for page collation

Standard concatenation joins document B after the final page of document A, whereas interleaving weaves one page from each input per round. Running the loop inside a background thread via the MDN Web Docs Web Workers API Reference keeps the interface responsive even on 500-page packets.

Choosing the right collation mode prevents manual drag-and-drop sorting on long scanned contracts. If you want chapter 2 to follow chapter 1 sequentially without alternating pages, use Merge PDF instead.

Workflow Input order Reverse last file Output sequence Common use case
Front + reversed back 2 PDFs (A1..A4, B4..B1) Checked A1, B1, A2, B2, A3, B3, A4, B4 Single-sided ADF duplex scans
Facing-page bilingual 2 PDFs (EN1..EN3, FR1..FR3) Unchecked EN1, FR1, EN2, FR2, EN3, FR3 Side-by-side translation booklets
Three-way collation 3 PDFs (A, B, C) Unchecked A1, B1, C1, A2, B2, C2 Multi-language event programs
Unequal lengths 2 PDFs (4 pages, 2 pages) Unchecked A1, B1, A2, B2, A3, A4 Trailing appendix or cover sheets
Sequential append 2+ PDFs Not applicable A1..An, B1..Bm Standard chapter merging

What happens when PDFs have unequal page counts?

If one input has 12 pages and another has 10 pages, the mixer alternates pairs for the first 10 rounds and appends pages 11 and 12 of the longer file at the end. No pages are ever discarded when counts differ.

Page dimensions, crop boxes, and vector text survive intact under the Library of Congress PDF 2.0 (ISO 32000-2) specification. If you are preparing mirror-imaged press proofs alongside interleaved sheets, pair this step with our horizontal PDF page mirror tool.

How trailing pages append after the shorter file ends

The interleaving loop runs up to the maximum page count across all uploaded files (Math.max), skipping any source whose array has already been exhausted. That guarantees deterministic ordering even when mixing 3 or more unequal packets.

Interleaving three or more documents for bilingual packets

Drop 3 or 4 PDFs into the list to collate trilingual manuals or multi-track conference handouts page by page. Remember to untick Reverse the last file whenever the final document is already sorted 1 through N.

For example, combining an English, Spanish, and German product sheet places page 1 of all three languages together before advancing to page 2. Reordering files in the list before mixing controls the exact language sequence.

Tip: If your scanner produced a blank back page on single-sided sheets, check the page count before mixing so blank backs do not shift subsequent pages out of sync.

Fixing upside-down back sides and duplex scan quirks

Flipping a paper stack along the short edge instead of the long edge rotates every back-side page by 180 degrees. Mixing before fixing orientation produces a PDF where every even-numbered page reads upside down, making digital reading and duplex printing awkward.

Checking the first two pages of your back-side PDF in a viewer before interleaving catches 180-degree flips immediately. Fixing orientation as a batch takes seconds and avoids manual per-page rotation after mixing.

Rotating flipped back-side batches before mixing

To avoid re-scanning the entire stack, fix upside-down back-side scans before interleaving by rotating the back-side PDF 180 degrees first. Then drop both files into Alternate & mix with Reverse the last file enabled.

Keeping sensitive scanned records off external servers

Tax returns, signed leases, and medical intake forms often require manual duplex scanning on home or office printers. All 0 bytes of your PDFs stay inside browser memory during mixing, with zero server uploads or temporary cloud storage.

Even multi-page identity packets, signed NDAs, or bank statements process offline once the page loads, so closing the browser tab clears every temporary buffer from system memory immediately without leaving any cached files behind.

Questions

When should I use alternate and mix instead of merging PDFs?

Use Alternate & mix when pages need to interleave one by one, such as odd and even sides from a single-sided scanner or bilingual facing pages. Standard merging appends all pages of the second file after the entire first file.

Why is Reverse the last file checked by default?

When you scan all front sides on a single-sided feeder and flip the stack over to scan the back sides, the second PDF records the last sheet's back first. Reversing the last file aligns page N's back with page N's front automatically.

What happens if my front and back PDFs have different page counts?

The mixer alternates one page from each file until the shorter document runs out, then places any leftover pages from the longer document at the end. No pages are dropped or truncated.

Can I interleave three or more PDFs at the same time?

Yes. Add 2, 3, or more PDFs to the file list and the mixer takes page 1 from each file in order, followed by page 2 from each file. Note that Reverse the last file applies only to the final file in the list.

Does alternating PDF pages preserve searchable OCR text?

Yes. Because pages are copied directly at the PDF object level rather than rasterized to images, embedded OCR text layers, vector graphics, and hyperlinks remain intact.

What should I do if the back-side scan came out upside down?

If flipping the paper stack rotated the back sides by 180 degrees, rotate that back-side PDF upright first using Rotate PDF, then return here to interleave both files.

Updated