$title->setText(html_entity_decode( $event['name'], ENT_HTML5 ) );
//$title->setAlign('center');
$title->setWidth(self::TITLE_WIDTH);
- $lineCount = $title->getLineCount();
- if ( $title->getLineCount() > 1 ) {
+ $lineCountTitle = $title->getLineCount() - 1;
+ if ( $lineCountTitle ) {
$pdfY -= $title->getLineHeight();
}
$title->draw($page->getCanvas(), self::PDF_RGT_COL_X, $pdfY);
- if ( $title->getLineCount() > 1 ) {
- $pdfY += $title->getLineHeight();
- }
$pdfY -= self::LINE_HEIGHT;
+ if ( $lineCountTitle ) {
+ $pdfY -= $title->getLineCount();
+ }
if ( $lineCount ) {
$pdfY -= $dateHeight;
}