workaround to avoid visual issue in PDFs

This commit is contained in:
alejandro.campos@artica.es 2022-10-10 09:49:11 +02:00
parent 4fba7077ec
commit a3eaaf1f5e
1 changed files with 10 additions and 1 deletions

View File

@ -1944,7 +1944,16 @@ function reporting_html_inventory($table, $item, $pdf=0)
$table1->head[$k] = $k;
$table1->headstyle[$k] = 'text-align: left';
$table1->cellstyle[$str_key][$k] = 'text-align: left;';
$table1->data[$str_key][$k] = $v;
if ($pdf === 0) {
$table1->data[$str_key][$k] = $v;
} else {
// Workaround to prevent table columns from growing indefinitely in PDFs.
$table1->data[$str_key][$k] = preg_replace(
'/([^\s]{30})(?=[^\s])/',
'$1'.'<br>',
$v
);
}
}
}
}