Write A PDF File Using Ruby

Write A PDF File Using Ruby
Using the open source PDF::Writer library for Ruby to create PDF documents on the fly and save them on the server.
require "rubygems"
# Get PDF::Writer from http://ruby-pdf.rubyforge.org/pdf-writer/
require "pdf/writer"
pdf = PDF::Writer.new
pdf.select_font "Times-Roman"
pdf.text "Hello World, Hello, Ruby, Hello PDF.", :font_size => 52, :justification => :center

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top