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

  • From: bobn@xxxxxxxxxx
  • To: "pdf4st@xxxxxxxxxxxxx" <pdf4st@xxxxxxxxxxxxx>
  • Date: Tue, 16 Oct 2012 06:00:20 -0700 (PDT)

Interesting. Row cell height is calculated by cell content, and row height is 
the maximum cell height. 
For bottom aligned cell content the text vertical position will have to be 
adjusted. 

I'll take a look; hopefully it's a quick fix.

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: