jung-kurt / gofpdf

A PDF document generator with high level support for text, drawing and images
http://godoc.org/github.com/jung-kurt/gofpdf
MIT License
4.29k stars 772 forks source link

how to align the lower boundry of two adjacent multicells #302

Closed sify21 closed 4 years ago

sify21 commented 4 years ago

I want two multicells placed next to each other, and I know which one contains more content. I can align the upper boundry with setXY, but how do I align the lower boundry?

jung-kurt commented 4 years ago

Good question, @sify21. The bottom of a MultiCell() is determined by the number of lines in the content, so you may have to resort to a kluge in which you add a number of blank lines to pad the smaller one. This is admittedly error-prone because you may not know how many wrapped lines the content will have. This is a definite shortcoming of the MultiCell method.

sify21 commented 4 years ago

Thanks for the reply. Finally I managed to do this using SplitText for caculating max row num and calling CellFormat multiple times to achieve the effects of using MultiCell.

jung-kurt commented 4 years ago

Good solution.