I happen to own a multi-function printer that can print double-sided, but only scans single-sided with the automatic document feeder (ADF).
Dual-side ADFs are rather error-prone and also very expensive in comparison to single-side ADFs, so I didn’t buy one of those.
Now I have the problem that scanning dual-sided documents became a bit more painful than expected. You can scan the „odd“ pages into a PDF, and the „even“ pages into another, but then you have the problem that you need to merge these, and the „even“ pages even are in the wrong order, if you just swap the paper stack you could easily scan for the odd pages, and scan the „backsides“.
So… thanks to AI, I vibe-coded a PDF merger for this case with Claude. I only had to correct a few lines of code because Claude didn’t full get the idea that there always needs to be one odd page, but the number of even pages can be one less, and that you cannot detect this from the scan of „even“ pages, which may contain one empty back-side of an odd page… or at least I didn’t manage to make Claude get this.
It takes the (right-order) odd pages PDF with page numbers 2n + 1, and the (reverse order) even pages PDF (pages 2n, if existing) and merges them to one PDF.
Problem solved. And I provide the .jar here. Without any warranty, of course, though.
