Refolio
Contents

Refolio guide

Refolio is a VS Code extension that turns PDFs of bound books — scanned or photocopied — into readable PDFs. Spreads are split at the gutter; skew, page curl near the spine and the binding shadow are corrected; the whole book gets one layout. Everything runs on your machine; scans are never sent anywhere.

This is a beta. Please report what you notice in the issues. Installing and a first run are in the quick guide.

Use

Right-click a scanned PDF in the Explorer and choose Refolio: Make a clean PDF (it is in the Command Palette too). Progress is shown in a notification. The result is saved beside the scan as book.refolio.pdf; the scan itself is not changed. Press Open when it is done to see it in the viewer. The PDFs you processed are also listed in the Refolio view.

A 76-page book scanned at 600 dpi takes about two minutes on a desktop CPU.

A whole folder

Right-click a folder and choose Refolio: Make clean PDFs of a folder, or press Make clean PDFs of a folder… in the sidebar. The PDFs in the folder are made one after another. If its subfolders have PDFs too, Refolio asks whether to include them. PDFs made before can be skipped or made again. Results, and PDFs inside the output folder, are not taken for scans. Cancelling stops there.

Where results go and their names

Change them by clicking them under Settings in the sidebar.

What Refolio does

  1. Splits spreads. A landscape scan is taken for a spread and split into two pages at the gutter. Refolio looks for the blank band between the pages, so text printed into the binding shadow is not cut.
  2. Straightens and trims. The scanner’s black ground and the edges of other pages beside the page go too.
  3. Flattens page curl. Lines that bend towards the spine are made straight, and squeezed glyphs get their width back — only on pages where the curl is visible.
  4. One layout for the book. The smallest standard paper size (A6–A3, B6–B4, Letter) that holds the pages at their size, with the text block in the same place on every page.
  5. Shadow and paper. The binding shadow is removed, the paper turns white and its grain is smoothed. Glyphs deep in the fold are lifted gently so they can be read.
  6. Super-resolution of pages scanned below 300 dpi, to 400 dpi on the GPU.

Colour pages stay colour; black-and-white pages stay black and white.

For the best results, see the scanning tips.

Settings

Each one is changed by clicking it under Settings in the sidebar.

Setting Default
Output folder beside the scan Where the results go.
File name {name}.refolio The name of a result; {name} is the name of the scan.
Super-resolution on Super-resolution for pages below 300 dpi.
Image quality 80 Image quality of the pages (JPEG). Higher makes larger files.

Ask an AI assistant

You can ask an AI assistant such as Claude Code to “make this PDF readable with Refolio”. Refolio comes with a reference written for assistants; using Refolio from the command line is described there too.

Not yet in the beta

License

Refolio is MIT-licensed. The extension bundles uv (MIT or Apache-2.0) and PDF.js (Apache-2.0); Real-ESRGAN (BSD-3-Clause) and the Python packages are downloaded during setup. See THIRD_PARTY_NOTICES.md.