Skip to content

Commit

Permalink
add ownerpassword and options (#651)
Browse files Browse the repository at this point in the history
Co-authored-by: Barry vd. Heuvel <[email protected]>
  • Loading branch information
hebbet and barryvdh authored Jul 13, 2021
1 parent b1e1d9a commit 44c5f21
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/PDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,19 +246,18 @@ public function render()
$this->rendered = true;
}


public function setEncryption($password)
public function setEncryption($password, $ownerpassword = '', $pc = [])
{
if (!$this->dompdf) {
throw new Exception("DOMPDF not created yet");
}
$this->render();
return $this->dompdf->getCanvas()->get_cpdf()->setEncryption("pass", $password);
if (!$this->dompdf) {
throw new Exception("DOMPDF not created yet");
}
$this->render();
return $this->dompdf->getCanvas()->get_cpdf()->setEncryption($password, $ownerpassword, $pc);
}


protected function convertEntities($subject)
{

$entities = array(
'' => '&euro;',
'£' => '&pound;',
Expand Down

0 comments on commit 44c5f21

Please sign in to comment.