Open BrainforgeUK opened 1 year ago
@BrainforgeUK Could you provide an example of code generating this error ?
I don't know how it got into the state where $this->cell_padding = null
This is one of a number of occassions where earlier versions would silently ignore the error, and it is often benign anyway - maybe in this instance a value of 0 would be assumed.
PHP 7.4 and 8 are less forgiving and the unexpected / 'this will never happen' has to be coded for! - such as here.
I can confirm that I had the same issue as of PHP 7.4 onwards, using TCPDF v6.6.2 The suggested fix did resolve it for me as well - I have tested on both PHP 7.4 and PHP 8.1
@BrainforgeUK - your example is missing a close bracket BTW ;)
@jausions - The errors would be something like the attached screenshot.
So the full function should maybe look something like this:
public function getCellHeight($fontsize, $padding=TRUE) { $height = ($fontsize * $this->cell_height_ratio); if ($padding && !empty($this->cell_padding)) { $height += ($this->cell_padding['T'] + $this->cell_padding['B']); } return round($height, 6); }
Hope this helps!
Thanks @kosmro Could you open a pull-request request here to fix this?
Thanks @kosmro Could you open a pull-request request here to fix this?
I'll look into it tonight :)
Can you close this issue ? 6.6.3 is out and #620 is merged
Cannot generate output due to ... TCPDF ERROR: Some data has already been output, can't send PDF file
Solution I implemented using a class override ... ` public function getCellHeight($fontsize, $padding=TRUE) {
`