Skip to content

Instantly share code, notes, and snippets.

@greg-randall
Last active March 23, 2023 14:39
Show Gist options
  • Select an option

  • Save greg-randall/44dd0f535d7f9671a959c64ee0634c3f to your computer and use it in GitHub Desktop.

Select an option

Save greg-randall/44dd0f535d7f9671a959c64ee0634c3f to your computer and use it in GitHub Desktop.
Convert a folder of PDFs to JPGs at web resolutions, and replace spaces with underscores while we're at it.
rename "s/[\s()]/_/g" *; rename "s/_+/_/g" * ; find *.pdf -exec convert -colorspace sRGB -density 150 {} -background white -alpha remove -alpha off -resize 1600x1600 -quality 100 {}.jpg \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment