19 declare(strict_types=1);
45 $output = preg_replace(
'#[\\\\/:*?"<>|]#',
'-', $output);
46 $output = $dir .
'/' . $output;
59 if (basename($output) === $output) {
64 $job->setFilename($output);
66 $job->setOutputMode($delivery_type);
68 $renderer->generatePDF($service, $purpose,
$config, $job);
69 return $this->
deliverPDF($output, $delivery_type);
72 protected function deliverPDF(
string $file,
string $delivery_type)
74 if (file_exists($file)) {
75 if (strtoupper($delivery_type) === self::PDF_OUTPUT_DOWNLOAD) {
77 } elseif (strtoupper($delivery_type) === self::PDF_OUTPUT_INLINE) {
79 } elseif (strtoupper($delivery_type) === self::PDF_OUTPUT_FILE) {
90 $tmp_file = dirname(reset($src)) .
'/complete_pages_overview.html';
93 if (file_exists($filename)) {
94 $html_content .= file_get_contents($filename);
97 file_put_contents($tmp_file, $html_content);
static getRendererConfig(string $service, string $purpose, string $renderer)
static getRendererInstance(string $renderer)
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
static getRendererMapForPurpose(string $service, string $purpose)
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.