Every repository with this icon (
Every repository with this icon (
| Description: | Fast, Nimble PDF Writer for Ruby edit |
-
It would be very convenient to a project I'm doing if it were possibly to do, e.g.
pdf.cell blahblah, :vertical_align => :center
and have that work as easily as :horizontal_align => :center does. You can "fake it" with vertical padding fairly easily... right until you end up word wrapping.
I'm currently banging my head against this for my project but if I get a generalizable solution working I'll try getting you guys the code.
Comments
-
4 comments Created 6 months ago by sandalMake bounding_box fully enclose nested elementsrequestxAs per Greg's request in the following mailing list post, here's a feature request: http://groups.google.com/group/prawn-ruby/browse_thread/thread/229740129eb9a506
The behaviour of bounding_box should be changed to fully enclose nested elements, such that Prawn elements that follow a bounding box containing multiple nested elements with varying heights will align with the bottom edge of the bounding_box, and not the bottom edge of the last rendered nested element. This should obviously only be the case if the following element uses 'cursor' to denote it's y-axis alignment.
I hope I've elucidated adequately.
Samå
Comments
Any news on this?
I'm having this same issue, now sure how to fix it for now.
no news. I may get this in for 0.5, if not, definitely 0.6
I'm sure a lot of people would love to see it sooner of course :)
This would include me :)
In either case, thanks in advance! -
having to do pdf.y = dy + bounds.absolute_bottom sucks.
Comments
-
0 comments Created 4 months ago by sandalmaybe make span and bounding box API compatible?requestxPOLS?
Comments
-
0 comments Created 5 months ago by sandalbring 'supported viewers' document onto wiki and put link on prawn webpagerequestxComments
-
1 comment Created 6 months ago by sandalpdf-writerxTweak Document#text_box to implement some features from PDF::Writer#add_text_wraprequestxThis is a request for several enhancements to Prawn#text_box so that it would support the features of #add_text_wrap in PDF::Writer.
When Prawn#text_box is called with the :truncate or :ellipses option the text which is not displayed in the text box is returned.
When Prawn#text_box is called with the :angle => (int in range 0..259) option, the text is rotated as it would be using PDF::Writer #add_text_wrap
When Prawn#text_box is called with the :justification => :left | :center option, the text is justified as it would be using PDF::Writer #add_text_wrap
Comments
-
0 comments Created 3 months ago by sijokgrequestxadding :background_color option to :text in table cellreviewxHi
I am creating a request here according to the discussions athttp://groups.google.com/group/prawn-ruby/browse_thread/thread/aef186542b250187
Could anybody give a solution to this?Thanks
skComments
-
I made some changes to text_box to support the :align attribute
Comments
-
3 comments Created 3 months ago by expilorequestxAdd DeviceN colorspace supportwould_be_nicexThis is a prerequisite for a project aimed at creating a duotone tool in ruby. Necessary for all documents using spot colors. BTW I guess there is no reason why Prawn should not support all the remaining colorspaces that PDF offers.
Comments
Patches welcome. This isn't on the critical path but I'd be fine accepting a patch for it as long as it was reasonable. This won't get done by me though, in the foreseeable future.
-
0 comments Created 2 months ago by ericluowrap chinese text failed when render tag document by require 'prawn/format'reviewxI had used prawn to generate some chinese pdf documents successfully
when set the :wrap option to :character, but the wrap function failed for document which include tags
after I required 'prawn/format'.Comments
-
Comments
-
I have looked through the PDF-reference and can't find a way to do rectangles with rounded corners at the PDF-level, so it seems this should be done like PDF-writer did it, by drawing lines and curves.
A working method was submitted by Benjamín Cárdenas Salamandra in this thread:
http://groups.google.com/group/prawn-ruby/browse_thread/thread/9505ce1a5fade296Here it is again:
def rectangle_rounded(point,width,height,radius) x,y = point line [x+radius,y],[x+width-radius,y] line [x+radius,y-height],[x+width-radius,y-height] line [x,y-radius],[x,y-height+radius] line [x+width,y-radius],[x+width,y-height+radius] l1 = radius * KAPPA y1 = y-radius+l1 x1 = x+radius-l1 x2 = x+width-radius+l1 y2 = y-height+radius-l1 curve [x,y-radius],[x+radius,y], :bounds => [[x,y1],[x1,y]] curve [x+width-radius,y],[x+width,y-radius], :bounds => [[x2,y],[x+width,y1]] curve [x+width,y-height+radius],[x+width-radius,y-height], :bounds => [[x+width,y2],[x2,y-height]] curve [x+radius,y-height],[x,y-height+radius], :bounds => [[x1,y-height],[x,y2]] endUPDATE: This method works well for stroked rounded rectangles, but not if you fill it. I'm working on an implementation that works for both cases, but haven't finished it yet.
Comments
Here is a page that describes several implementations of rounded rectangles for cairo which is a vector library with primitives like pdf
-
1 comment Created 26 days ago by jonteboltext method :at and :align optionsdocumentationxHaving both :at and :align options on the text method, makes you think they would work together, which they don't. This should be fixed, or reflected in the documentation.
Comments
-
As someone else mentioned on the list, support for configuring letter spacing would be nice.
Comments
I noticed prawn-format has some support for this. You can add something like
if options[:letter_spacing] state[:text].character_space(options[:letter_spacing]) endto Line#draw_on and then do something like
text "foo", :letter_spacing => 123, but this messes up line wrapping and likely a bunch of other things.
Maybe someone can build on it, though.
Patches are welcome for this feature but they need to be well tested and come with examples.
If it helps someone else, I ended up faking it (in Rails, hence the
chars) like this:require "prawn/format" my_string = "some text\nsome more" spaced_string = my_string.lines.map {|line| line.chars.split('').join('<space></space>') }.join('<br/>') text spaced_string, :tags => { :space => { :width => '1' } } # fake letter-spacing -
Greg, Brad, I've incorporated the changes you recommended and made a few other improvements (such as a couple new specs). Please note that everything for both transparency and stamp is now on the master of my Prawn fork: http://github.com/bluejade/prawn. I hope that works okay for you.
Please let me know if anything else should be done on these.
Best,
Daniel
Comments
That works fine. I'll try to merge this soon so you don't need to worry about complications with your master branch diverging.
-
Feature ticket Re: Impending Feature Freeze for 0.6 Release
0 comments Created 6 days ago by BluejadeHere is a list of features I've submitted to be considered for the 0.6 release, all available through the master branch at http://github.com/Bluejade/prawn:
>stroke dash
stroke cap style (a late addition)
stroke join style (another late addition)
transparency
stampsComments











