From 44c5f21300f8ce9c27bc02abeee1dd1d5cb10b0a Mon Sep 17 00:00:00 2001 From: hebbet Date: Tue, 13 Jul 2021 10:25:24 +0200 Subject: [PATCH] add ownerpassword and options (#651) Co-authored-by: Barry vd. Heuvel --- src/PDF.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/PDF.php b/src/PDF.php index 61707ad..f31b421 100644 --- a/src/PDF.php +++ b/src/PDF.php @@ -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( '€' => '€', '£' => '£',