, , , . Y Y, , , .
" " , ($pdf->PageNo()) Y ($pdf->GetY()).
. " ", . -, " ", . , Y , .
, .
X- .
public function GetVerticalPosition() {
return array(
'page' => $this->PageNo(),
'y' => $this->GetY(),
);
}
public function SetVerticalPosition( $pos ) {
$this->page = $pos['page'];
$this->SetY( $pos['y'] );
}
public function FurthestVerticalPosition( $aPos, $bPos = null ) {
if ( $bPos === null ) $bPos = $this->GetVerticalPosition();
if (
($aPos['page'] > $bPos['page'])
||
($aPos['page'] == $bPos['page'] && $aPos['y'] > $bPos['y'] )
) {
return $aPos;
}else{
return $bPos;
}
}
. , .
$startPos = $this->GetVerticalPosition();
$furthestPos = $this->GetVerticalPosition();
, , ( ), .
$furthestPos = $this->FurthestVerticalPosition( $this->GetVerticalPosition(), $furthestPos );
$this->SetVerticalPosition( $startPos );
, , .
$this->SetVerticalPosition( $furthestPos );
, .