prawn-svg SVG renderer

282 views
Skip to first unread message

Roger Nesbitt

unread,
Mar 26, 2010, 3:55:18 PM3/26/10
to Prawn
Hello,

I've recently put together an SVG renderer for Prawn.

http://rubygems.org/gems/prawn-svg
http://github.com/mogest/prawn-svg

It's very much a work-in-progress, but I've got it to the stage where
it acceptably renders most of the examples from the SVG spec. Check
out the README on github for a list of features it supports.

I wrote it mainly to get Scruffy graphs into a PDF as vector graphics,
and it's doing that great.

Happy for any and all feedback. I've got a bit more free time over
the next week where I'll be adding more features and tidying things up
a bit. Let me know if you have a particular request.

Cheers,
Roger

Gregory Brown

unread,
Mar 28, 2010, 8:19:05 PM3/28/10
to Prawn

On Mar 26, 3:55 pm, Roger Nesbitt <ro...@seriousorange.com> wrote:
> Hello,
>
> I've recently put together an SVG renderer for Prawn.
>

> http://rubygems.org/gems/prawn-svghttp://github.com/mogest/prawn-svg


>
> It's very much a work-in-progress, but I've got it to the stage where
> it acceptably renders most of the examples from the SVG spec.  Check
> out the README on github for a list of features it supports.

Whoa, this is excellent news. Really bad timing on my end, with a
wedding coming up this weekend. But SVG is at the top of my wishlist
for Prawn, so I'll try to review soon!

-greg

Gregory Brown

unread,
Mar 28, 2010, 8:23:37 PM3/28/10
to prawn...@googlegroups.com

Ah, just at a glance, it might be a good idea to use
Prawn::Document.extensions rather than re-opening the Prawn::Document
class. We'll be moving towards this internally where it makes sense,
and it'll help you future proof things a bit:

http://github.com/sandal/prawn/blob/master/lib/prawn/document.rb#L85

Roger Nesbitt

unread,
Apr 12, 2010, 12:50:17 AM4/12/10
to Prawn
On Mar 29, 12:23 pm, Gregory Brown <gregory_br...@letterboxes.org>
wrote:

> Ah, just at a glance, it might be a good idea to use
> Prawn::Document.extensions rather than re-opening the Prawn::Document
> class.  We'll be moving towards this internally where it makes sense,
> and it'll help you future proof things a bit:
>
> http://github.com/sandal/prawn/blob/master/lib/prawn/document.rb#L85

Just back from holiday and seen your post - thanks. I've changed the
code to use the extensions framework.

Running the specs and then looking in the spec/sample_output directory
is probably the quickest way to get a handle on what it's doing at the
moment. More than happy to keep working on it; it's still at a basic
stage.

Cheers
Roger

Yarin Kessler

unread,
Aug 6, 2013, 1:11:15 PM8/6/13
to prawn...@googlegroups.com
Hi Roger,

Thanks for putting this together- It's worked great for us so far, however we've run into the issue of not being able to perform x/y scaling. I've detailed the issue here: https://github.com/mogest/prawn-svg/issues/25.

Is this a known issue? Is it something addressable? We're evaluating tools and this is a critical feature for us.

Thanks--
Yarin
Reply all
Reply to author
Forward
0 new messages