From 305d06c391f90b7b3a47a9a272c89bd3a97c6d26 Mon Sep 17 00:00:00 2001 From: Fabio Ivona Date: Fri, 19 Feb 2021 10:39:52 +0100 Subject: [PATCH] Update Template.php --- src/Template.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Template.php b/src/Template.php index fa668c4..d91094a 100644 --- a/src/Template.php +++ b/src/Template.php @@ -142,13 +142,17 @@ protected function to_pdf_file(string $output_file): string $temporary_result_file = Str::of($temporary_directory) ->append(DIRECTORY_SEPARATOR) - ->append($this->set_extension($this->get_filename($compiled_file), 'pdf')); + ->append($this->set_extension($this->get_filename($compiled_file), 'pdf')) + ->replace("/./", '/'); if (!File::exists($temporary_result_file)) { throw TemplateProcessingException::missing_converted_file($temporary_result_file); } - File::move($temporary_result_file, $this->set_extension($output_file, 'pdf')); + + $temporary_result_file = (string) $temporary_result_file; + $output_file = (string) $this->set_extension($output_file, 'pdf'); + File::move($temporary_result_file, $output_file); return $output_file; }