diff --git a/CHANGELOG.md b/CHANGELOG.md index ba33564..d2936e8 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ All notable changes to `easy-pdf` will be documented in this file. ## [Unreleased] +## 2.4.0 - 2022-05-30 +- `setPage()` method added for setting current page. + ## 2.3.0 - 2022-02-08 - Add support for Laravel 9. diff --git a/README.md b/README.md index 79c49d0..ef5516b 100755 --- a/README.md +++ b/README.md @@ -80,6 +80,12 @@ You can add image to the pdf with dimensions. $pdf->addImage($imagePath, 80, 60, 30, 20); // x-y coordinates and width-height ``` +You can set active page using `setPage()` method. +```php +// This will set the active page as 1. +$pdf->setPage(1); +``` + ### Parsing pdf You can parse the pdf and get the page you want. diff --git a/src/EasyPdf.php b/src/EasyPdf.php index 8de4c65..33e063d 100755 --- a/src/EasyPdf.php +++ b/src/EasyPdf.php @@ -268,6 +268,19 @@ public function setFooter($footer = null) return $this; } + /** + * Sets the active page of PDF. + * + * @param int $page + * @return $this + */ + public function setPage(int $page): self + { + $this->pdf->setPage($page); + + return $this; + } + /** * Save pdf to given path.. *