Skip to content

Instantly share code, notes, and snippets.

@newtriks
Created February 8, 2013 12:34
Show Gist options
  • Save newtriks/4738772 to your computer and use it in GitHub Desktop.
Save newtriks/4738772 to your computer and use it in GitHub Desktop.
Convert PDF to JPG removing transparency and add white background using ImageSorcery (supports multi-page PDF's)
#https://github.com/EricR/image_sorcery
require 'image_sorcery'
image = ImageSorcery.new("example.pdf")
image.manipulate!(format: "jpg", :resize => '400x300', :quality => 100, :density => 150, :background => 'white', :alpha => 'Remove')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment