Jump to content

Printing problem and PDF


Studio381

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.