github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

yob / prawn forked from sandal/prawn

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 7
    • 97
  • Source
  • Commits
  • Network (97)
  • Issues (0)
  • Downloads (21)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (9)
    • cymk_invert
    • master ✓
    • otf2
    • pantone
    • rotated_text
    • templates
    • templates_0_6_3
    • templates_2010
    • winansi
  • Tags (21)
    • Triassic
    • Proterozoic
    • Permian-1
    • Permian
    • Hadean
    • Archaean
    • 0.7.1
    • 0.6.3
    • 0.6.2
    • 0.6.1
    • 0.5.1
    • 0.4.1
    • 0.3.0
    • 0.2.3
    • 0.2.2
    • 0.2.1
    • 0.2.0
    • 0.1.2_1
    • 0.1.2
    • 0.1.1
    • 0.1.0
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Fast, Nimble PDF Writer for Ruby — Read more

  cancel

http://prawn.lighthouseapp.com/projects/9398/home

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Now you can build gems from edge.  But please don't 
sandal (author)
Tue Jan 05 07:22:44 -0800 2010
commit  df8459882d113d55551018caa53a9e9f848fcd3d
tree    88639732fda66c6abed614b97bef71b52a2e2fa3
parent  a48c998c191d4b5ac0dfad5ebe538ed290446b78
prawn /
name age
history
message
file .gitignore Wed Nov 26 10:05:02 -0800 2008 ignoring the pkg directory that is created with... [riopro]
file .gitmodules Sun Nov 30 20:19:02 -0800 2008 TTFunk mega hack [sandal]
file COPYING Wed Apr 30 08:43:32 -0700 2008 Gettin' all legal and shiznit [sandal]
file HACKING Tue Jan 05 07:04:56 -0800 2010 Remove prawn-format ref [sandal]
file LICENSE Sun Jul 19 19:41:36 -0700 2009 update project docs [sandal]
file README Tue Jan 05 07:03:46 -0800 2010 Remove prawn-format ref [sandal]
file Rakefile Tue Jan 05 07:22:44 -0800 2010 Now you can build gems from edge. But please d... [sandal]
directory bench/ Sat Jan 17 17:58:06 -0800 2009 update reference pdfs [sandal]
directory bugs/ Sun Nov 15 08:53:51 -0800 2009 Fix loadpath [sandal]
directory data/ Mon May 25 10:41:07 -0700 2009 add support for 16bit PNGs, types 4 and 6 [yob]
directory examples/ Tue Jan 05 06:52:12 -0800 2010 minor tweaks [sandal]
directory lib/ Loading commit data...
directory meta/ Tue Jan 05 07:22:44 -0800 2010 Now you can build gems from edge. But please d... [sandal]
directory reference_pdfs/ Mon Dec 07 09:15:04 -0800 2009 Changed do_the_print to @inked. Changed :for to... [Daniel Nelson]
directory spec/
directory vendor/
directory www/ Thu Jan 29 09:34:27 -0800 2009 Tweaking styles [sandal]
README
= Prawn: Fast, Nimble PDF Generation For Ruby

Prawn is a PDF writing library for Ruby designed to be tiny, fast, and nimble,
just like the majestic sea creature.

Development on this library was initially made possible thanks to 
the many people who donated to the Ruby Mendicant project: 
http://rubymendicant.wikidot.com 

The project is currently maintained by Gregory Brown, with lots of help from
the community.

== Quick Start

Getting started with Prawn can be as simple as:

 require 'prawn'
 pdf = Prawn::Document.new
 pdf.text("Prawn Rocks")
 pdf.render_file('prawn.pdf')

But prawn can do a lot more:

===Any page size you can think of

 Prawn::Document.new('A0')

...gives you an _really_ big page.

 Prawn::Document.new(:page_size   => [11.32, 8.49],
                     :page_layout => :portrait)

...giving you a postage stamp.

{Learn more}[link:classes/Prawn/Document.html]

===Multiple Font Handling with UTF-8 Support

 pdf.text("Prawn Rocks")
 pdf.font("/myfont.ttf")
 pdf.text("Prawn still rocks in a different font")

...allowing you to use any font you want.

{Learn more}[link:classes/Prawn/Font.html]

===Drawing graphics directly into the page

Simple shapes:

 pdf.stroke do
   pdf.circle_at [100,100], :radius => 25
   pdf.rectangle [300,300], 100, 200
 end

(note, you need to stroke the path to put "ink" there)

{Learn more}[link:classes/Prawn/Graphics.html]

===Embedding JPEG and PNG Images Natively

Reading an image directly from a file:

 prawn_logo = "#{Prawn::BASEDIR}/data/images/prawn_logo.png"
 pdf.image prawn_logo, :at => [50,450], :width => 450

Or reading it from an IO stream:

 require "open-uri"
 pdf.image open("http://prawn.majesticseacreature.com/media/prawn_logo.png")

{Learn more}[link:classes/Prawn/Images.html]

===Measurement Conversion Tools for Your Sanity

Prawn deals exclusively in PDF points... which work out to about 2.83464567mm... 
don't try and do it in your head, instead, let Prawn help you:

 require "prawn/measurement_extensions"

 Prawn::Document.generate(:page_layout => :portrait, 
                     :left_margin => 10.mm,    # different
                     :right_margin => 1.cm,    # units
                     :top_margin => 0.1.dm,    # work
                     :bottom_margin => 0.01.m, # well 
                     :page_size => 'A4') do
   text "Prawn Rocks"
 end

{Learn more}[link:classes/Prawn/Measurements.html]

== Resources

=== Website:

http://prawn.majesticseacreature.com

=== Examples:

http://github.com/sandal/prawn/tree/stable/examples

For tables and grid based layout:

http://github.com/sandal/prawn-layout/tree/stable/examples

For encryption, password protection, and permissions:

http://github.com/madriska/prawn-security/tree/stable/examples

(or gem unpack prawn-core, prawn-security and prawn-layout if you want to run them locally)

=== Bug Tracker / Wiki:

http://github.com/sandal/prawn/issues
http://github.com/sandal/prawn-layout/issues
http://github.com/madriska/prawn-security/issues

=== Source Code:

http://github.com/sandal/prawn
http://github.com/sandal/prawn-layout
http://github.com/madriska/prawn-security

=== Mailing List:

http://groups.google.com/group/prawn-ruby

=== IRC:

Find us in #prawn on irc.freenode.net
  Gregory Brown: <sandal>
  James Healy: <yob>               
  
== Notes to Developers: 

See HACKING file for details on getting set up with a local build.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server