No commit activity in last 3 years
No release in over 3 years
This gem is a simple Paperclip processor which uses rmagick to convert uploaded pdf files to a image file. This processor supports multiple pages
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 5.1.0, ~> 5.1
 Project Readme

Ruby on Rails 4 Paperclip pdf to img Processor

This gem is a simple Paperclip processor which uses rmagick/ImageMagik to convert uploaded pdf files to a image file. This processor supports multiple pages

Requirements

Installation

This gem is written and tested on Ruby on Rails 4 only. However, this could work on other versions as well provided that paperclip and rmagick is working.

In order to install it, add

gem 'pdf2img-paperclip-processor'

to your Gemfile and run

bundle install

in your console. Bundler should take care of all the rest.

or else, you can just download the file and copy it to paperclip processors folder of your project.

rmagick Instalation

Install rmagick from source or using your favorite package manager.

Various Linux distributions should use similar methods with their respected package managers.

Using Processor

Use it as you would any other Paperclip processor. In your model:

class Document < ActiveRecord::Base
  
  has_attached_file :pdf,
          :styles => { :final_doc => {:format => "png"}},
          :processors => [:pdf2img]      

which will convert your pdf document into a png, and keep both files (.png and .pdf) on the server

Release info

Be warned, this gem is released as early beta version. If you are using it you are doing so on your own responsibility.

Have fun with it and drop me a note if you like it.