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]);
|
reset ($value[1]);
|
||||||
|
|
||||||
while (list($k, $v) = each($value[1])) {
|
foreach ($value[1] as $k => $v) {
|
||||||
$this->_straightOut($k . ' ');
|
$this->_straightOut($k . ' ');
|
||||||
$this->_writeValue($v);
|
$this->_writeValue($v);
|
||||||
}
|
}
|
||||||
|
@ -218,16 +218,30 @@ class fpdi_pdf_parser extends pdf_parser
|
|||||||
|
|
||||||
if (!is_null($box) && $box[0] == pdf_parser::TYPE_ARRAY) {
|
if (!is_null($box) && $box[0] == pdf_parser::TYPE_ARRAY) {
|
||||||
$b = $box[1];
|
$b = $box[1];
|
||||||
return array(
|
if($k == NULL){
|
||||||
'x' => $b[0][1] / $k,
|
return array(
|
||||||
'y' => $b[1][1] / $k,
|
'x' => NAN,
|
||||||
'w' => abs($b[0][1] - $b[2][1]) / $k,
|
'y' => NAN,
|
||||||
'h' => abs($b[1][1] - $b[3][1]) / $k,
|
'w' => NAN,
|
||||||
'llx' => min($b[0][1], $b[2][1]) / $k,
|
'h' => NAN,
|
||||||
'lly' => min($b[1][1], $b[3][1]) / $k,
|
'llx' => NAN,
|
||||||
'urx' => max($b[0][1], $b[2][1]) / $k,
|
'lly' => NAN,
|
||||||
'ury' => max($b[1][1], $b[3][1]) / $k,
|
'urx' => NAN,
|
||||||
);
|
'ury' => NAN,
|
||||||
|
);
|
||||||
|
}else{
|
||||||
|
return array(
|
||||||
|
'x' => $b[0][1] / $k,
|
||||||
|
'y' => $b[1][1] / $k,
|
||||||
|
'w' => abs($b[0][1] - $b[2][1]) / $k,
|
||||||
|
'h' => abs($b[1][1] - $b[3][1]) / $k,
|
||||||
|
'llx' => min($b[0][1], $b[2][1]) / $k,
|
||||||
|
'lly' => min($b[1][1], $b[3][1]) / $k,
|
||||||
|
'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'])) {
|
} else if (!isset($page[1][1]['/Parent'])) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user