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

  • From: bobn@xxxxxxxxxx
  • To: "pdf4st@xxxxxxxxxxxxx" <pdf4st@xxxxxxxxxxxxx>
  • Date: Tue, 16 Oct 2012 14:43:04 -0700 (PDT)

Ivo,
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.

Bob



________________________________
 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
 
Hi,

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

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

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

Other related posts: