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

yob / pdf-wrapper

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 19
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (4)
    • master ✓
    • pango_cleanup
    • tablework
    • transforms
  • Tags (13)
    • 0.3.1
    • 0.3.0
    • 0.2.1
    • 0.2.0
    • 0.1.4
    • 0.1.3
    • 0.0.7
    • 0.0.6
    • 0.0.5
    • 0.0.4
    • 0.0.3
    • 0.0.2
    • 0.0.1
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.

A unicode aware PDF writing library that uses the ruby bindings to various c libraries ( like cairo, pango, poppler and rsvg ) to do the heavy lifting. — Read more

  cancel

http://rubyforge.org/projects/pdf-wrapper

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

This URL has Read+Write access

update a spec to pass on both my systems 
yob (author)
Mon Nov 23 22:19:05 -0800 2009
commit  eb0028d8c7b1fbb0bfa2f7c122b2e0dd0854d5a8
tree    ce7c7a241c768fd335598bdc5d950d0e939036ee
parent  54e91ac4434fa5a74890a7dac3edef3451751728
pdf-wrapper /
name age
history
message
file .gitignore Loading commit data...
file CHANGELOG
file DESIGN
file README.rdoc
file Rakefile
file TODO
directory examples/
directory lib/
directory specs/
README.rdoc

Overview

PDF::Wrapper is a PDF generation library that uses the cairo and pango native libraries to do the heavy lifting. It essentially just wraps these general purpose graphics libraries with some sugar that makes them a little easier to use for making PDFs. The idea is to lever the low level tools in those libraries (drawing shapes, laying out text, importing raster images, etc) to build some higher level tools - tables, text boxes, borders, lists, repeating elements (headers/footers), etc.

The API started off roughly following that of PDF::Writer, but it has since diverged significantly. I’ve spent some time contributing to a pure Ruby PDF generation library (Prawn) and its elegant and simple API is having a strong effect on the direction I’ve been taking PDF::Wrapper.

A key motivation for writing this library is cairo’s support for Unicode in PDFs. All text functions in this library require UTF-8 input, although as a native English speaker I’ve only tested non ASCII text a little, so any feedback is welcome.

There also seems to be a lack of English documentation available for the ruby bindings to cairo/pango, so I’m aiming to document the code as much as possible to provide worked examples for others. I’m learning as I go though, so if regular users of either library spot techniques that fail best practice, please let me know.

It’s early days, so the API is far from stable and I’m hesitant to write extensive documentation just yet. It’s the price you pay for being an early adopter. The examples/ dir should have a range of sample code, and I’ll try to keep it up to date.

I welcome all feedback, feature requests, patches and suggestions. In particular, what high level widgets would you like to see? What do you use when building reports and documents in GUI programs?

Installation

The recommended installation method is via Rubygems.

  gem install pdf-wrapper

Author

James Healy <jimmy@deefa.com>

License

  • GPL version 2 or the Ruby License
  • Ruby: www.ruby-lang.org/en/LICENSE.txt

Dependencies

  • ruby/cairo
  • ruby/pango (optional, required to add text)
  • ruby/rsvg2 (optional, required for SVG support)
  • ruby/gdkpixbuf (optional, required for GIF/JPG support)
  • ruby/poppler (optional, required for embedding PDF images)

These are all ruby bindings to C libraries. On Debian/Ubuntu based systems (which I develop on) you can get them by running:

    aptitude install libcairo-ruby libpango1-ruby librsvg2-ruby libpoppler-glib-ruby

For users of other systems, I’d love to receive info on how you set these bindings up.

ruby/cairo is also available as a gem (cairo), which may be installable if you have a copy of the cairo source available on your system.

Compatibility

JRuby users, you’re currently out of luck. In theory it should be possible to use the Java bindings to the native libraries we need, but as I’m not a JRuby user, it’s not an itch I’ve been motivated to scratch.

Rubinius users, I have no idea.

Ruby1.9 users, the current release of ruby/cairo (1.5.1) added support for 1.9. PDF::Wrapper itself is 1.9 compatible.

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