background preloader

Managing PDF in Rails

Facebook Twitter

Mileszs/wicked_pdf. PDF Generation with Wicked pdf in Rails « Web::Framework.find_by_name "Rails" I am using ruby 1.9.2 and rails 3. I think Wicked pdf is better than other rails pdf generation plugins. To start with wicked follow the steps : Step 1: Open the terminal and go to your rails application folder. $ cd /home/MyApp Install wkhtmltopdf first .Open gem file, and add the line gem ‘wkhtmltopdf’ $ bundle install Wicked pdf is using the wkhtmltopdf to create a pdf document from a rails html template.

With wicked pdf we can, Define documents structure through a simple html document.Theme them through CSSJust Download the static complied version from wkhtmltopdf home page. Step 2: Install wicked pdf plugin Step 3:Add pdf instructions to your controller. In my rails app I created an action index_pdf. Step 4: Create a view file in app/view/index_pdf.erb Put the link in your app, in your home page or somewhere. <%= link_to ‘Create PDF document’, index_pdf_path(@user, :format => :pdf) %> the index_pdf_path is the path I mentioned in the route.rb file, match “/download_pdf(. Its ‘wicked!!’ Downloads - wkhtmltopdf - Convert html to pdf using webkit (qtwebkit)

Heroku-pdf/config/environment.rb at master · jordan-brough/heroku-pdf. Heroku-pdf-3/config/initializers/wicked_pdf.rb at master · michaelklem/heroku-pdf-3.