Skip to content

Commit

Permalink
Update Template.php
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio-ivona authored Feb 19, 2021
1 parent 7f943b7 commit 305d06c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 305d06c

Please sign in to comment.