PDF tools: crop, split, rotate, merge, and spreads
Prepare PDFs for OCR with LEXO's local PDF tools. Extract page ranges, split, crop margins, rotate, merge, and split two-up spreads, in the app or the CLI.
LEXO’s PDF tools run entirely on your computer. They need no Google account and no network. Use them to clean up a document before OCR, or on their own.
Every tool is available in the desktop app (the Edit, Pages, and PDF tabs) and as a lexo pdf command.
Page ranges
Commands that take --pages (-p) accept:
all,odd, oreven;- single pages and ranges, comma-separated:
1-3,7,10-. An open range like10-runs to the last page.
Pages are numbered from 1.
Inspect a PDF
lexo pdf info book.pdf
Prints the page count, whether the PDF has a text layer, and the size of page 1.
Extract a page range
lexo pdf extract book.pdf --pages "1-3,7,10-" -o subset.pdf
In the app: select thumbnails, then Extract selected to new file….
Split into several files
By chunk size:
lexo pdf split book.pdf --every 10
Or at specific pages, each of which starts a new file:
lexo pdf split book.pdf --at 4,7
Output goes next to the source unless you pass --out-dir.
Crop margins
Percentages trimmed from each edge:
lexo pdf crop book.pdf --top 8 --bottom 8 -o trimmed.pdf
lexo pdf crop book.pdf --left 5 --right 5 --pages odd -o trimmed.pdf
In the app, the Edit tab’s crop box does the same visually, and you can apply it to one page, all pages, or a selection. Cropping rotated pages trims the edge you see in the preview.
Rotate
lexo pdf rotate book.pdf --degrees 90 -o rotated.pdf
lexo pdf rotate book.pdf -d 180 --pages even -o rotated.pdf
--degrees takes any multiple of 90.
Merge
lexo pdf merge front.pdf body.pdf back.pdf -o book.pdf
Files are joined in the order given. In the app, Append PDF(s)… in the PDF tab adds files to the end of the open document.
Split two-up spreads
Scans of open books often hold two pages per image. Split each into left and right halves:
lexo pdf split-spread scans.pdf -o pages.pdf
--ratio moves the cut if the gutter isn’t centred, from 0.05 to 0.95 (default 0.5):
lexo pdf split-spread scans.pdf --ratio 0.52 -o pages.pdf
In the app, Show split line lets you drag the cut onto the gutter, then Split two-up at line.
Splitting respects page rotation and the current crop, so re-splitting an already-split PDF doesn’t duplicate halves.