I need the scheduler-to-pdf to display line breaks in the pdf output. Does anyone know how to modify the code to make this work?
The work-around for this is to use the MultiCell function. I am using the month view only and all of my events are of type “event_line”. So in pdfWrapper.php:
public function drawMonthEvents...
//draw the event_line div with border and fill
$this->cb->Cell($width, $height, '', 1, '', 'L', 1);
//draw the event text
if ($event['type'] == 'event_clear') {
$this->cb->MultiCell($width, $height, $text, 'LTRB', 'L', 1, '', $x, $y, '', '', true, false);
} else {
$this->cb->MultiCell($width, $height, $text, 'LTRB', 'L', 1, '', $x, $y, '', '', true, false);
}
Also, since I was outputting html, I needed to determine the height based on the number of lines I was outputting. I will never output more than 7 lines, and the way I tested this was to count the number of times “” appeared in the string:
//count the lines to determine height
$linescount = substr_count($text, '<strong>');
//deal with IE
if($linescount == 0){
$linescount = substr_count($text, '<STRONG>');
}
if($linescount == 1){
$thisheight = 4;
}elseif($linescount == 2){
$thisheight = 8;
}elseif($linescount == 3){
$thisheight = 12;
}elseif($linescount == 4){
$thisheight = 16;
}elseif($linescount == 5){
$thisheight = 20;
}elseif($linescount == 6){
$thisheight = 24;
}elseif($linescount == 7){
$thisheight = 28;
}else{
$thisheight = 5;
}
//final height
$height = $thisheight;