prawn: creating pdf in ruby
DESCRIPTION
This is the talk I gave at FOSDEM 2009TRANSCRIPT
![Page 1: Prawn: Creating PDF in Ruby](https://reader034.vdocuments.us/reader034/viewer/2022052505/55592f10d8b42a4f3d8b4858/html5/thumbnails/1.jpg)
PrawnCreate PDFs with Ruby
![Page 2: Prawn: Creating PDF in Ruby](https://reader034.vdocuments.us/reader034/viewer/2022052505/55592f10d8b42a4f3d8b4858/html5/thumbnails/2.jpg)
Tom Klaasen
• Co-founder of (http://10to1.be)
• @tomklaasen
• http://tomklaasen.net
![Page 3: Prawn: Creating PDF in Ruby](https://reader034.vdocuments.us/reader034/viewer/2022052505/55592f10d8b42a4f3d8b4858/html5/thumbnails/3.jpg)
Prawn
• Prawn takes the pain out of generating beautiful printable documents, while still remaining fast, tiny and nimble.
![Page 4: Prawn: Creating PDF in Ruby](https://reader034.vdocuments.us/reader034/viewer/2022052505/55592f10d8b42a4f3d8b4858/html5/thumbnails/4.jpg)
History
• Gregory Brown: “What if I could just do open source for a while, non-commercially?”
• http://www.oreillynet.com/ruby/blog/2008/03/id_love_to_quit_my_job_sort_of.html
![Page 5: Prawn: Creating PDF in Ruby](https://reader034.vdocuments.us/reader034/viewer/2022052505/55592f10d8b42a4f3d8b4858/html5/thumbnails/5.jpg)
Goals
• The features you need, without all the complexity
• Built in support for UTF-8
• Easy image embedding
• Flexible table drawing
• Simplified content positioning
![Page 6: Prawn: Creating PDF in Ruby](https://reader034.vdocuments.us/reader034/viewer/2022052505/55592f10d8b42a4f3d8b4858/html5/thumbnails/6.jpg)
Code Examples
![Page 7: Prawn: Creating PDF in Ruby](https://reader034.vdocuments.us/reader034/viewer/2022052505/55592f10d8b42a4f3d8b4858/html5/thumbnails/7.jpg)
“Hello, World”
![Page 8: Prawn: Creating PDF in Ruby](https://reader034.vdocuments.us/reader034/viewer/2022052505/55592f10d8b42a4f3d8b4858/html5/thumbnails/8.jpg)
Render a book
![Page 9: Prawn: Creating PDF in Ruby](https://reader034.vdocuments.us/reader034/viewer/2022052505/55592f10d8b42a4f3d8b4858/html5/thumbnails/9.jpg)
Render a book (2)
![Page 10: Prawn: Creating PDF in Ruby](https://reader034.vdocuments.us/reader034/viewer/2022052505/55592f10d8b42a4f3d8b4858/html5/thumbnails/10.jpg)
Render a book (3)
• PDF: 84 pages
• “Took 6.582318 to generate.”
![Page 11: Prawn: Creating PDF in Ruby](https://reader034.vdocuments.us/reader034/viewer/2022052505/55592f10d8b42a4f3d8b4858/html5/thumbnails/11.jpg)
Tables
![Page 12: Prawn: Creating PDF in Ruby](https://reader034.vdocuments.us/reader034/viewer/2022052505/55592f10d8b42a4f3d8b4858/html5/thumbnails/12.jpg)
Tables (2)
![Page 13: Prawn: Creating PDF in Ruby](https://reader034.vdocuments.us/reader034/viewer/2022052505/55592f10d8b42a4f3d8b4858/html5/thumbnails/13.jpg)
Bounding boxes
![Page 14: Prawn: Creating PDF in Ruby](https://reader034.vdocuments.us/reader034/viewer/2022052505/55592f10d8b42a4f3d8b4858/html5/thumbnails/14.jpg)
Bounding boxes (2)
![Page 15: Prawn: Creating PDF in Ruby](https://reader034.vdocuments.us/reader034/viewer/2022052505/55592f10d8b42a4f3d8b4858/html5/thumbnails/15.jpg)
The Future
• Now: alpha
• Project is gaining traction quickly
• First stable production release: June 2009
![Page 16: Prawn: Creating PDF in Ruby](https://reader034.vdocuments.us/reader034/viewer/2022052505/55592f10d8b42a4f3d8b4858/html5/thumbnails/16.jpg)
How to get it
• gem install prawn
![Page 17: Prawn: Creating PDF in Ruby](https://reader034.vdocuments.us/reader034/viewer/2022052505/55592f10d8b42a4f3d8b4858/html5/thumbnails/17.jpg)
References
• http://prawn.majesticseacreature.com/
• http://advent2008.hackruby.com/past/2008/12/17/awn_and_the_future_of_ruby_pdf_generation
![Page 18: Prawn: Creating PDF in Ruby](https://reader034.vdocuments.us/reader034/viewer/2022052505/55592f10d8b42a4f3d8b4858/html5/thumbnails/18.jpg)
Thank You
• @tomklaasen
• http://tomklaasen.net