Menu

Prefered position for line break

Help
Jascha
2014-10-13
2014-10-14
  • Jascha

    Jascha - 2014-10-13

    Hello,
    is there a possibility to hint prefered position for a line break? E.g. I have to following text:
    "Family Firstname1 Lastname1 and Firstname2 Lastname2"

    If possiblle I want to have the line breaks before or after the "and". I can't use   between Firstname and Lastname because sometimes they are so long that they don't fit in the line. Then the break should be there but whenever possible not.

    Thank You
    Jascha

     

    Last edit: Jascha 2014-10-13
  • Simon

    Simon - 2014-10-13

    I'd use something like GetStringWidth() to find the length of the text, then manually add the line break based on that.

    See: http://www.tcpdf.org/doc/code/classTCPDF.html#a8075c1f04b6fbddc957cff786c4b16d9

     
  • Jascha

    Jascha - 2014-10-14

    This would be a possibility, but its a lot of work. I would have to implement my own line break logic. Is there nothing in tcpdf which can achive this?

     

Log in to post a comment.