Skip to content

Commit

Permalink
Backport "Refactor/fix implement signature image process"
Browse files Browse the repository at this point in the history
  • Loading branch information
oliworx committed Aug 11, 2023
1 parent e33ded1 commit 1195328
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/SignaturePdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,9 @@ public function signature()
$this->pdf->AddPage($width > $height ? 'L' : 'P', [$width, $height]);
$this->pdf->useTemplate($pageIndex);

if ($this->hasSealImgOnEveryPages) $this->implementSignatureImage((int) $pageIndex);
if ($this->hasSealImgOnEveryPages || $i === ($this->image['page'] ?? 0)) {
$this->implementSignatureImage($i);
}
}

$certificate = $this->cert->getCert()->original;
Expand All @@ -279,7 +281,6 @@ public function signature()
'A' // Authorize certificate
);

if (!$this->hasSealImgOnEveryPages) $this->implementSignatureImage();
if (empty($this->fileName)) $this->fileName = Str::orderedUuid();
if ($this->hasSignedSuffix) $this->fileName .= '_signed';

Expand Down

0 comments on commit 1195328

Please sign in to comment.