Rails PDF Plugin

This is one the the most simple and useful plugins you can use. To get started you will need to install the PDF::Writer gem.

gem install pdf-writer

Install the Rails PDF Plugin.

script/plugin install svn://rubyforge.org//var/svn/railspdfplugin/railspdf

To create a PDF document for an action, you need to change the action’s view extension from rhtml to rpdf. In the rpdf view you can insert PDF::Writer code. For example, to create a Hello, World PDF use just these two lines of code in the rpdf view:

pdf.select_font "Times-Roman"
pdf.text "Hello, #{@name}.",
  :font_size => 72, :justification => :center

Artima has a great article that covers in great detail the PDF::Writer library. With PDF::Writer you can create PDF documents with embedded images, business charts, tables, etc. With this plugin you can create PDF reports and documents from rails applications. You can create a PDF document for all of your blog posts.

Technorati Tags: , , , , , , ,

Enjoy. Share. Be Happy.
  • Twitter
  • Facebook
  • StumbleUpon
  • del.icio.us
  • Tumblr
  • Google Bookmarks
  • FriendFeed
  • Yahoo! Buzz
  • Reddit
  • Digg
  • HackerNews
  • Suggest to Techmeme via Twitter
  • LinkedIn
  • Ping.fm
  • Identi.ca
  • Mixx
  • Furl

Related posts:

  1. Graphs Rails Plugin
  2. Riff Rails Plugin
  3. Rails Flash Charting Plugin
  4. Calendar Helper Plugin
  5. Acts As Blog Plugin

This entry was posted in Ruby, TechKnow. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

3 Comments

  1. Max Williams
    Posted August 15, 2008 at 4:28 am | Permalink

    hi

    I’m trying to install this – i got the gem fine but the plugin link isn’t working: i get
    “svn: Connection closed unexpectedly”.

    Just saying in case you need to update the link or something.

    thanks
    max

  2. Alex Dorandish
    Posted September 17, 2008 at 12:45 am | Permalink

    this does not work with rub 2.1
    any solutions?

  3. Renius
    Posted January 27, 2010 at 9:04 pm | Permalink

    How to work whith cyrillic symbols?

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*