Studio381 Posted December 12, 2007 Share Posted December 12, 2007 I've got an application that prints out to a file in PDF fomat. The PDF routine I'm using truncates the input strings if they are over approx 100 characters. So I wanted to check the input strings (length unknown) and split them before calling the PDF routine. I'd thought of something like... $workingstring = $_POST[inputstring]; while (strlen($workingstring)>90 {$printstring=substr($workingstring(0,90); $pdf->Cell(0,10,$printstring,0,1); $workingstring=substr_replace($workingstring,"",0,90); } $pdf->Cell(0,10,$workingstring,0,1); This (assuming it works, I haven't tried it yet) has the drawback that it splits the string after 90 characters which could be in the middle of a word and I'd much rather split the string after eg 85 or 94 characters to avoid splitting words. Can anyone show me a better way to do this? Thanks, John. Link to comment https://forums.phpfreaks.com/topic/81367-printing-problem-and-pdf/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.