[Sorry, but I’m assuming you have some basic knowledge of the command line!]

Because I’ve cut back on Adobe subscriptions, but needed to export a PDF book’s spreads to JPEGs..

Bit of faff with the ChatGPT monster and came to this two step solution.

This solution requires Poppler and Imagemagick (and comfort using Bash or zsh)

I have already got Homebrew installed. (Crikey, it makes installing and updating packages a breeze.) So:

brew install poppler imagemagick

Automating JPEG Spreads from PDF

Point your Terminal at the folder that contains the PDF

PDF to JPEGs @ 150DPI

pdftoppm -jpeg -r 150 yourbook.pdf page

Once pages are exported and named page-[ddd]…

Automate the pairing,

Here’s a simple shell loop (bash/zsh). Just replace N with your total number of pages (e.g. 50) [! Exclude end/single pages from count]:

N=142
for ((i=2; i<=N; i+=2)); do
  j=$((i+1))
  pi=$(printf "%03d" $i)
  pj=$(printf "%03d" $j)
  spread=$(printf "%03d" $((i/2+1)))
  if [[ -f page-$pi.jpg && -f page-$pj.jpg ]]; then
    echo "Processing pages $pi and $pj..."
    magick page-$pi.jpg page-$pj.jpg +append spread-$spread.jpg
    echo "✅ Created spread-$spread.jpg"
  else
    echo "⚠️ Missing page-$pi.jpg or page-$pj.jpg"
  fi
done

Last updated on 4th septiembre 2025