How to create thumbnail for first pdf page with carrierwave

Viewed 6254

I'm processing thumbnail for PDF file in this way:

  version :thumb do
    process :resize_to_limit => [260, 192]
    process :convert => :jpg
    process :set_content_type
  end

  def set_content_type(*args)
    self.file.instance_variable_set(:@content_type, "image/jpeg")
  end

But when PDF file is multipage it produces thumbnail for all pages in one jpg file. Is there any way to produce thumbnail only for first page?

3 Answers
Related