
Using the open source PDF::Writer library for Ruby to create PDF documents on the fly and save them on the server.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
pdf.save_as("HelloWorld.pdf") |
No comments:
Post a Comment