# FYI: Text::Box Feature Fixed in Prawn

**URL:** <https://www.ruby-forum.com/t/fyi-text-box-feature-fixed-in-prawn/193595>\
**Category:** Rails\
**Created:** [August 20, 2010, 9:28am UTC](https://www.ruby-forum.com/t/fyi-text-box-feature-fixed-in-prawn/193595 "2010-08-20T09:28:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ceekays](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5f9b8f/32.png) [@ceekays](https://www.ruby-forum.com/u/ceekays)\
**Post date:** [August 20, 2010, 9:28am UTC](https://www.ruby-forum.com/t/fyi-text-box-feature-fixed-in-prawn/193595/1 "2010-08-20T09:28:21Z")

</div>

Rails Riders,

For those who like “prawning PDF docs to their RoR apps” :  
Text::Box has been patched to default the text-box height in stretchy  
boxes  
to the distance to the bottom of the page if no height is supplied (or  
if  
overflow is :expand).

> <https://github.com/practicingruby/prawn/commit/51bc993aadcd928c08dab5ec4eb56201653151c9>
>
> Fixes Text::Box in stretchy bounding boxes to calculate its height based
> on the …distance remaining to the bottom of the margin box, not the
> distance to the bottom of the current bounding box (which is usually
> zero).

Peace,

* * *

Edmond  
Software Developer | Baobab Health Trust ([http://www.baobabhealth.org/](http://www.baobabhealth.org/))  
|  
Malawi

Cell: +265 999 465 137 | +265 881 234 717

_“Many people doubt open source software and probably donâ€™t realize that  
there is an alternativeâ€¦ which is just as good…” – Kevin Scannell_

---------- Forwarded message ----------  
From: Brad E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Date: 2010/8/19  
Subject: [dev] RFC: Text::Box in stretchy bounding box uses margin\_box  
for  
default height

In an effort to fix tables inside spans [#142], I have pushed the  
following commit to master:

> <https://github.com/practicingruby/prawn/commit/51bc993aadcd928c08dab5ec4eb56201653151c9>
>
> Fixes Text::Box in stretchy bounding boxes to calculate its height based
> on the …distance remaining to the bottom of the margin box, not the
> distance to the bottom of the current bounding box (which is usually
> zero).

Previously, Text::Box would refuse to render inside a stretchy  
bounding box because the height to the “bottom” of the box was zero.  
I’ve patched this to default the text-box height in stretchy boxes to  
the distance to the bottom of the page if no height is supplied (or if  
overflow is :expand). This has not yet fixed the table problem, but  
it’s getting better.

I’m generally pretty cavalier about pushing stuff that passes all of  
the specs, but I wanted to throw this out there for review in case  
there might be a corner case I’m missing.

-be
