From d9db41e8dccc0a4b8e700ae5e1b5c72aa1cd4978 Mon Sep 17 00:00:00 2001 From: Jacob Siefer Date: Thu, 7 Apr 2022 10:45:11 +0200 Subject: [PATCH] Append uri resolver issues to typeset result --- src/PdfGenerator.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/PdfGenerator.php b/src/PdfGenerator.php index e76fb99..bf6fd2e 100644 --- a/src/PdfGenerator.php +++ b/src/PdfGenerator.php @@ -34,8 +34,14 @@ public function __construct(array $schemes = [], string $baseUri = null, string */ public function render(string $html): Result { + $this->uriResolver->errors = []; + $result = $this->htmlToPdf->render($html, $this->uriResolver); - $result->version=$this->version; + $result->version = $this->version; + + if ($this->uriResolver->errors) { + array_push($result->issues, ...$this->uriResolver->errors); + } return $result; } @@ -47,8 +53,14 @@ public function render(string $html): Result */ public function renderMultiple(array $html): Result { + $this->uriResolver->errors = []; + $result = $this->htmlToPdf->renderMultiple($html, $this->uriResolver); - $result->version=$this->version; + $result->version = $this->version; + + if ($this->uriResolver->errors) { + array_push($result->issues, ...$this->uriResolver->errors); + } return $result; }