Skip to content

Commit

Permalink
Added GetPageHeight and GetPageWidth methods to FPDFPlus class.
Browse files Browse the repository at this point in the history
  • Loading branch information
rudissaar committed Dec 6, 2017
1 parent 323648d commit b62e32c
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion FPDFPlus.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,37 @@ public function WriteLn($height, $text, $link = '')
/**
*
* @param float|null $height
* @param string $hmtl
* @param string $html
* @param string $link
*/
public function WriteHtml($height, $html, $link = '')
{
$this->WriteLn($height, strip_tags($html), $link);
}

/**
*
* @return float
*/
public function GetPageHeight()
{
$height = $this->h;
$topMargin = $this->tMargin;
$bottomMargin = $this->bMargin;

return (float) ($height - $topMargin - $bottomMargin);
}

/**
*
* @return float
*/
public function GetPageWidth()
{
$width = $this->w;
$leftMargin = $this->lMargin;
$rightMargin = $this->rMargin;

return (float) ($width - $rightMargin - $leftMargin);
}
}

0 comments on commit b62e32c

Please sign in to comment.