Title: Line breaks from textarea not respected in PDF output (ChronoForms8 / TCPDF)
Message:
Hi there,
I'm using ChronoForms8 and generating a PDF with TCPDF. I have a form with two textarea fields: "Billing Address" and "Delivery Address". In the PDF template, I'm using {data:rechnungsadresse}
and {data:lieferadresse}
to insert the content. However, line breaks from the textarea input are not preserved – everything appears in a single line in the generated PDF.
I tried using :html
to convert the line breaks into <br />
, but it doesn't seem to work inside the table cells.
Is there a proper way to display multiline textarea content with line breaks in the TCPDF output?
Thanks in advance for any tips!
Hi mobusag
I have added this to the next update:
{data.br:field_name}
and it will convert new lines to line breaks
But for now you will need a PHP action:
return nl2br($this->data("field_name"));
then you can use {var:php_action_name} in your PDF template content