Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How can I let \n become new line in tcpdf with html #760

Open
gangli66 opened this issue Nov 1, 2024 · 2 comments
Open

How can I let \n become new line in tcpdf with html #760

gangli66 opened this issue Nov 1, 2024 · 2 comments

Comments

@gangli66
Copy link

gangli66 commented Nov 1, 2024

I use php and laravel to create an PDF by TCPDF.
My code is like this:

...

{{ $myvalue }}

... But when $myvalue has some \n, it does not wrap to new line and all words are in the same line. I change \n to
or
before it render the pdf, but it display
or
without wrapping to new line.
@littlepackage
Copy link

I change \n to

What did you change \n to? Did you use HTML like <br>? That should work.

@Justinas-Jurciukonis
Copy link

There is handy function called nl2br. Use it to convert \n to <br/>, otherwise it will not work anywhere, as it's not related to this particular package

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants