fixes for PHP 8
This commit is contained in:
parent
0a47a984e0
commit
227b3d503c
2
fpdi.php
2
fpdi.php
@ -571,7 +571,7 @@ class FPDI extends FPDF_TPL
|
||||
|
||||
reset ($value[1]);
|
||||
|
||||
while (list($k, $v) = each($value[1])) {
|
||||
foreach ($value[1] as $k => $v) {
|
||||
$this->_straightOut($k . ' ');
|
||||
$this->_writeValue($v);
|
||||
}
|
||||
|
@ -218,6 +218,18 @@ class fpdi_pdf_parser extends pdf_parser
|
||||
|
||||
if (!is_null($box) && $box[0] == pdf_parser::TYPE_ARRAY) {
|
||||
$b = $box[1];
|
||||
if($k == NULL){
|
||||
return array(
|
||||
'x' => NAN,
|
||||
'y' => NAN,
|
||||
'w' => NAN,
|
||||
'h' => NAN,
|
||||
'llx' => NAN,
|
||||
'lly' => NAN,
|
||||
'urx' => NAN,
|
||||
'ury' => NAN,
|
||||
);
|
||||
}else{
|
||||
return array(
|
||||
'x' => $b[0][1] / $k,
|
||||
'y' => $b[1][1] / $k,
|
||||
@ -228,6 +240,8 @@ class fpdi_pdf_parser extends pdf_parser
|
||||
'urx' => max($b[0][1], $b[2][1]) / $k,
|
||||
'ury' => max($b[1][1], $b[3][1]) / $k,
|
||||
);
|
||||
}
|
||||
|
||||
} else if (!isset($page[1][1]['/Parent'])) {
|
||||
return false;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user