## TL;DR

Scanned image PDFs have inconsistent page sizes, rotations, and encodings that break naive mergers. Normalize each PDF first (standardize page size and rotation), then merge the normalized copies; keep the originals untouched.

## Error

```text
agent's pdf merger broke with error on scanned image pdfs
```

## Steps

1. Identify the failing PDFs: check page sizes, rotations, and whether pages are images or text. Expected: inconsistent sizes and rotations across the set.
2. Normalize each PDF: rotate to upright and scale pages to a standard size (letter or A4). Expected: uniform pages.
3. Merge the normalized copies with the merger. Expected: the merge completes.
4. Verify the merged PDF: page count matches the input total and each page is legible. Expected: a complete, readable merged file.
5. Wrap the merger in per-file error handling so one corrupt PDF is skipped with a log entry instead of killing the merge. Expected: resilient merging.

## When to use

- PDF merging fails specifically on scanned image PDFs.
- Merged output has missing or garbled pages.

## When not to use

- Text-based PDFs fail to merge (a different merger bug).
- A single PDF is corrupt (repair or re-scan that file).

## Tool compatibility

- Python PDF libraries (pypdf, pdfmerge tooling) in custom agents.

## Variant phrasings

### PDF merge failed on scanned receipts

Same failure, receipt-specific wording.

### Could not combine image PDFs

The generic form of the same problem.

## Why it happens

Scanners produce PDFs with whatever page geometry the scan had. Mergers that assume uniform pages choke on the mix; normalization removes the assumption.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_6GdCAYY_SgtZreb3VakoZg
