[pdf4st] Re: cell heights and vertical alignment of text

  • From: Ivo Roefs <ivo.roefs@xxxxxxxxx>
  • To: pdf4st@xxxxxxxxxxxxx
  • Date: Wed, 17 Oct 2012 09:15:10 +0200

Hi Bob,

I think it's OK to set the height calculation to the row height.
In the very rare case where you would want different cell heights in one row, i imagine one could work with nested tables, or row spans.

kind regards,
Ivo Roefs

Op 16/10/2012 23:43, bobn@xxxxxxxxxx schreef:
Would it be helpful to change the table cell height calculation and change it to be the row height? 
Are there cases where that would not be a good choice?

HTML tables set cells to the calculated row height, perhaps that's what the PDF table should do. 
Row span will have to be looked at carefully, but it should not be too hard.


From: Ivo Roefs <ivo.roefs@xxxxxxxxx>
To: "pdf4st@xxxxxxxxxxxxx" <pdf4st@xxxxxxxxxxxxx>
Sent: Tuesday, October 16, 2012 6:38:34 AM
Subject: [pdf4st] cell heights and vertical alignment of text


I've got a question about cell heights and vertical alignment of text.
In following example there's a table with 1 row, 2 cells.
The font size of the text in the first cell is smaller than the second cell.
Both texts are aligned to the bottom of the cell.

I get unexpected results:
    The 2 cells have a different height. I'd expect that all cells of a row would have the same height?
    Because of this the texts are not bottom aligned.

Maybe I'm doing this the wrong way? Can anybody help me out on this?

kind regards,
Ivo Roefs

    " self new exampleTableCellVerticalAlignmentOfText saveAndShowAs: 'exampleTableCellVerticalAlignmentOfText.pdf' "

    | report |
    report := R4PReport new.
    report portrait.
    report page:
            [:page |
            page table:
                    [:table |
                    table row:
                            [:row |
                            row cell:
                                    [:cell |
                                        border: 0.1;
                                    (cell text)
                                        fontSize: 6;
                                        string: 'The quick brown fox'].
                            row cell:
                                    [:cell |
                                    cell border: 0.1.
                                    (cell text)
                                        string: 'Jumps over the lazy dog']]]].
--- PDF4Smalltalk discussion //www.freelists.org/list/pdf4st

--- PDF4Smalltalk discussion //www.freelists.org/list/pdf4st

Other related posts: