I want to print simple text file (no style, formatting ) ,such that it fits in letter-size page and any overflow should be wrap to next line etc.
wordwrap()
php wordwrap function is doing what needed , but I am not sure how much character at maximum that fit on single line of letter-size page.
I hope this is not silly question . Do I need to look other way e.g px /font-size / max page size in pixels etc .
thanks in advance for any kind of help 🙂
Note: printing will be done from desktop application like notepad , wordpad or whatever text editing application available
You won’t be able to predict at what size the text is going to be printed out on client side, so this will be completely impossible to do in PHP. You’ll have to rely on the client doing the line breaks.
If you need full control over the printed result on that level, consider generating a PDF file.