Skip to content

Commit

Permalink
Merge pull request #11 from tarfin-labs/set-page-method-support
Browse files Browse the repository at this point in the history
`setPage()` method added.
  • Loading branch information
tkaratug authored May 30, 2022
2 parents 4471400 + 6a8bb18 commit 647aa31
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
13 changes: 13 additions & 0 deletions src/EasyPdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -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..
*
Expand Down

0 comments on commit 647aa31

Please sign in to comment.