Skip to content

Commit

Permalink
fix signature integration
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaasuni committed Apr 4, 2024
1 parent 85cdd33 commit 2f90315
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Output.php
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ public function getOutPDFString(): string
. 'startxref' . "\n"
. $startxref . "\n"
. '%%EOF' . "\n";
return $out . $this->signDocument($out);
return $this->signDocument($out);
}

/**
Expand Down Expand Up @@ -2694,9 +2694,8 @@ protected function getOutSignatureFields(): string
*/
protected function signDocument(string $pdfdoc): string
{
$out = '';
if (! $this->sign) {
return $out;
return $pdfdoc;
}

// remove last newline
Expand Down Expand Up @@ -2777,8 +2776,7 @@ protected function signDocument(string $pdfdoc): string
$signature = current($signature);
$signature = str_pad($signature, $this::SIGMAXLEN, '0');
// Add signature to the document
$out = substr($pdfdoc, 0, $byte_range[1]) . '<' . $signature . '>' . substr($pdfdoc, $byte_range[1]);
return $out;
return substr($pdfdoc, 0, $byte_range[1]) . '<' . $signature . '>' . substr($pdfdoc, $byte_range[1]);
}

/**
Expand Down

0 comments on commit 2f90315

Please sign in to comment.