Closed neutralchung closed 2 years ago
Have you tried \r\n
? If that doesn't work I have no idea either.
I tried but still no use. Hope others can find the solution.
Have you tried if you can enter a linebreak when you use some PDF reader to fill the form? I think you can restrict input fields in PDF so that they don't allow linebreaks.
In any case I don't think this is an issue we can fix here, so I'm closing this.
The input fields can only multiline input. So there is no problem with the field. Only using code cannot insert linebreak.
Can you fill the form in a reader program and somehow save the form data as Xfdf file? That's the XML format that is used to store and load form data. It should look something like this: https://github.com/mikehaertl/php-pdftk/blob/master/tests/files/XfdfFileTest.xfdf
Then you could check what the reader writes to that file for a linebreak.
I just did a quick test myself:
\r\n
)pdftk
to fill a form: works\n
and filled the form again: worksI've also added this to the tests:
So I can't find any issue. The only thing I had to make sure: You really need to enable the multiline option when you create the PDF.
Hello, I would like to ask about how to add a line break when filling form? I tried '\n' and <'br'>. But it is not working. It is any way to insert a line break? Thanks.