Skip to content
Browse files

updated webpage

  • Loading branch information...
1 parent 110ba60 commit eb49570d39b5e54fcff15ae8993117330546d701 @practicingruby practicingruby committed Aug 3, 2008
View
BIN data/images/dice.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
30 examples/bounding_boxes.rb
@@ -0,0 +1,30 @@
+$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
+require 'prawn'
+
+Prawn::Document.generate("bounding_boxes.pdf") do
+
+ bounding_box [100,600], :width => 200 do
+ text "The rain in spain falls mainly on the plains " * 5
+ stroke do
+ line bounds.top_left, bounds.top_right
+ line bounds.bottom_left, bounds.bottom_right
+ end
+ end
+
+ bounding_box [100,500], :width => 200, :height => 200 do
+ stroke do
+ circle_at [100,100], :radius => 100
+ line bounds.top_left, bounds.bottom_right
+ line bounds.top_right, bounds.bottom_left
+ end
+
+ bounding_box [50,150], :width => 100, :height => 100 do
+ stroke_rectangle bounds.top_left, bounds.width, bounds.height
+ end
+ end
+
+end
+
+
+
+
View
13 examples/image2.rb
@@ -0,0 +1,13 @@
+# encoding: utf-8
+
+$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
+require "prawn"
+
+Prawn::Document.generate("image.pdf", :page_layout => :landscape) do
+ pigs = "#{Prawn::BASEDIR}/data/images/pigs.jpg"
+ image pigs, :at => [50,450], :width => 450
+
+ dice = "#{Prawn::BASEDIR}/data/images/dice.png"
+ image dice, :at => [50, 450], :scale => 0.75
+end
+
View
3 examples/utf8.rb
@@ -7,3 +7,6 @@
font "#{Prawn::BASEDIR}/data/fonts/DejaVuSans.ttf"
text "ὕαλον ϕαγεῖν δύναμαι· τοῦτο οὔ με βλάπτει." * 20
end
+
+
+
View
7 lib/prawn/graphics.rb
@@ -219,18 +219,21 @@ def stroke_color(color=nil)
# Strokes and closes the current path.
#
def stroke
+ yield if block_given?
add_content "S"
end
# Fills and closes the current path
#
- def fill
+ def fill
+ yield if block_given?
add_content "f"
end
# Fills, strokes, and closes the current path.
#
- def fill_and_stroke
+ def fill_and_stroke
+ yield if block_given?
add_content "b"
end
View
102 www/index.html
@@ -1,5 +1,99 @@
-<html>
-<body>
-<h1>O hai</h1>
+<html>
+<head>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
+<link href="prawn.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+
+<div id="contents">
+ <ul>
+ <li><a href="docs/index.html">Docs</li>
+ <li><a href="http://prawn.lighthouseapp.com">Bugs</a></li>
+ <li><a href="http://groups.google.com/group/prawn-ruby">Community</a></li>
+ <li><a href="http://github.com/sandal/prawn">Source</a></li>
+ </ul>
+
+<h1><i>Prawn: Fast, Nimble PDF Generation For Ruby</i></h1>
+<span style="color:ffffff; font-size: 0.8em">
+<b>Installable via <u><a href="http://rubygems.org">RubyGems</a></u> :&nbsp; <tt>gem install prawn</tt></b>
+<br>
+</span>
+
+<h2>Building printable documents doesn't have to be hard</h2>
+<p>
+ If you've ever needed to produce PDF documents before, in Ruby another language, you probably know how much it can suck. <span style="color: #eeff44"><b><i>Prawn takes the pain out of generating beautiful printable documents</b></i></span>, while still remaining fast, tiny and nimble. It is also named after a majestic sea creature, and that has to count for something.
+</p>
+<h2>The features you need, without all the complexity</h2>
+
+<p>
+In addition to being the <span style="color: #eeff44"><i><b>fastest pure Ruby PDF generation library</i></b></span>, Prawn has features that might prevent you from hating your job. The samples below give
+a taste of what Prawn based programs looks like, <span style="color: #eeff44"><b><i>click the code to reveal the PDF it generates.</i></b></span>
+</p>
+
+<h3>-- Built in support for UTF-8</h3>
+
+<p>
+Internationalized text in Prawn is as simple as providing UTF-8 strings for it to render, assuming you've got a Unicode aware TTF font handy. For those who are running on Ruby 1.9, any encoding that can be converted to UTF-8 will work out of the box!
+</p>
+
+<a href="media/utf8.pdf"><img src="media/utf8.png" style="padding-left: 1.5em;"/></a>
+
+<h3>-- Easy image embedding</h3>
+
+<p>
+Prawn makes embedding JPEG and PNG images a breeze. With support for alpha transparency, easy positioning and scaling of images, you'll have no problem
+including all the graphics you need in your documents.
+</p>
+
+<a href="media/image.pdf"><img src="media/images.png" style="padding-left: 1.5em;"/></a>
+
+<h3>-- Flexible table drawing</h3>
+
+<p>
+Prawn has built in support for rendering text in the form of tables, providing
+basic reporting functionality. This lets users focus on customizing their
+documents rather than forcing them to write a ton of low level graphics drawing
+code.
+</p>
+
+<a href="media/fancy_table.pdf"><img src="media/tables.png" style="padding-left: 1.5em;"/></a>
+
+<h3>-- Simplified content positioning</h3>
+
+<p>
+Anyone who has done work with a low level graphics engine knows that doing coordinate math isn't fun. Prawn simplifies this by allowing you to box off a sub-section of the document and treat it as its own mini-coordinate space. This means that all positioning is relative, making it easy to move things around your document while keeping your code clean.
+
+Text can also be flowed within these sectioned off bounding boxes, so this
+makes it trivial to generate columns of text on the fly.
+</p>
+
+<a href="media/bounding_boxes.pdf"><img src="media/bounding_boxes.png"/></a>
+
+<h3>-- And loads more to come</h3>
+
+<span style="color: #eeff44"><b><i>Prawn is currently alpha-level software under active development.</i></b></span> New features are cropping up every day, and we expect to see loads of cool things in the near future including integration with the popular <a href="http://rubyreports.org">Ruby Reports</a> project. For now, you can keep
+an eye on the latest new features by checking out the <a href="http://github.com/sandal/prawn/tree/master/examples">examples distributed
+with the source</a>, which include the code samples shown above and much, much more!
+
+<h2>Supported by the Ruby Community</h2>
+
+<p>The development on Prawn is in part made possible through donations from the community to
+Gregory Brown's <a href="http://rubymendicant.wikidot.com">Ruby Mendicant</a> project, but quickly outgrew its humble beginnings.</p>
+
+<p>Since the project began in April 2008, the project has seen contributions in the form of code, bug reports, and feature requests from a whole bunch of Ruby hackers. You can find many of their contributions by checking out the <a href="http://github.com/sandal/prawn/network">Github
+network graph</a> for the project. Although several have contributed patches to Prawn, special thanks goes out to <b>James Healy</b> and <b>Michael Daines</b> for being instrumental to the forward development of the library.</p>
+
+<p>Many people have expressed interest in using Prawn within their Rails applications, and for this purpose, you might be interested in checking out yet another community contribution, thorny_sun's <a href="http://cracklabs.com/prawnto">Prawnto</a> Rails plugin. Although this is not officially part of Prawn, we'll do what we can to make sure this plugin continues to work as things move forward</p>
+
+<p><span style="color: #eeff44"><b><i>Please join us in the development of Prawn so that it can become the library of choice for PDF generation in Ruby.</i></b></span> You can start by getting in touch with us on the <a href="http://groups.google.com/group/prawn-ruby">mailing list</a> or stopping by to chat in the <tt>#prawn</tt> channel on irc.freenode.net. There is lots left to be done, and we could use your help!</p>
+
+<h2>What are you waiting for?</h2>
+<p>It's time to generate some PDFs. Get Prawn via RubyGems with <tt>gem install prawn</tt> or clone us at <tt>git://github.com/sandal/prawn.git</tt></p>
+
+</div>
</body>
-</html>
+
+
+
View
BIN www/media/bounding_boxes.pdf
Binary file not shown.
View
BIN www/media/bounding_boxes.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN www/media/bounding_boxes_out.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN www/media/fancy_table.pdf
Binary file not shown.
View
BIN www/media/image.pdf
Binary file not shown.
View
BIN www/media/images.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN www/media/tables.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN www/media/utf8.pdf
Binary file not shown.
View
BIN www/media/utf8.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
72 www/prawn.css
@@ -0,0 +1,72 @@
+* {
+ margin: 0;
+ padding: 0;
+}
+
+body {
+ font: Verdana, "Lucida Grande", "Lucida Sans", sans-serif;
+ background-color: #141414;
+ color: #ffff66;
+ margin-bottom: 1em;
+}
+
+h2, h3, h4, h5, h6, p, pre, blockquote, form, fieldset, table, ul {
+ margin: 1em 0;
+}
+h2 {
+ font-size: 1.75em;
+}
+
+h2, h3 {
+ color: #ffccdd;
+}
+
+h1 {
+ color: #bb5566;
+ font-size: 1.25em;
+ margin-top: 0.5em;
+}
+
+a {
+ color: #ffffff;
+ text-decoration: none;
+}
+
+a:visited {
+ color: #ffffff;
+}
+
+a:hover, a:active {
+ color: #ffffff;
+}
+
+#contents {
+ width: 740px;
+ margin: 0 auto;
+ border: 1px solid #fff;
+ margin-top: 1em;
+ padding: 1em 1em 1em 3em;
+}
+
+#screenshots {
+ margin-top: 2em;
+ float: right;
+}
+
+ul {
+ text-align: center;
+ float: right;
+}
+
+li {
+ display: inline;
+ border-top: 1px solid #fff;
+ border-right: 1px solid #fff;
+ border-bottom: 1px solid #666;
+ border-left: 1px solid #666;
+ margin-right: 5px;
+ padding-left: 10px;
+ padding-right: 10px;
+ color: #fff;
+ font-weight: bold;
+}

0 comments on commit eb49570

Please sign in to comment.
Something went wrong with that request. Please try again.