Skip to content

Commit e4ba39c

Browse files
committed
It is evaluated if the source exists, in elements within a table
1 parent cf5f6f8 commit e4ba39c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Table.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,12 @@ public static function process($arraydata){
306306

307307
$text = $jasperObj->get_expression($field->objElement->textFieldExpression,$row);
308308
//change font for height row
309-
$font = $field->objElement->textElement->font->attributes();
310-
//$this->SetFont(array("font"=> $font->fontName, "fontstyle"=> (isset($font->isBold)?"B":""), "fontsize"=>$font->size));
311-
JasperPHP\Instructions::addInstruction(array("type"=>"SetFont","font"=> $font->fontName, "fontstyle"=> (isset($font->isBold)?"B":""), "fontsize"=>$font->size));
312-
JasperPHP\Instructions::runInstructions();
309+
if($field->objElement->textElement->font) {
310+
$font = $field->objElement->textElement->font->attributes();
311+
//$this->SetFont(array("font"=> $font->fontName, "fontstyle"=> (isset($font->isBold)?"B":""), "fontsize"=>$font->size));
312+
JasperPHP\Instructions::addInstruction(array("type"=>"SetFont","font"=> $font->fontName, "fontstyle"=> (isset($font->isBold)?"B":""), "fontsize"=>$font->size));
313+
JasperPHP\Instructions::runInstructions();
314+
}
313315
$height_new = $pdf->getStringHeight($width_column,$text)*$lineHeightRatio;
314316
//return default font
315317
//$this->SetFont($fontDefault);

0 commit comments

Comments
 (0)