Commit b98c1c14 authored by Mahmoud Aglan's avatar Mahmoud Aglan

GO THERE

parent 7f5b59a3
......@@ -606,7 +606,7 @@ class TutorialController extends Controller
@unlink($tmpOutput);
$response = new Response();
return $response->html($pdfContent, 200, [
return $response->html($pdfContent, 200)->withHeaders([
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="Book-of-the-ERP.pdf"',
'Content-Length' => (string) strlen($pdfContent),
......@@ -616,7 +616,7 @@ class TutorialController extends Controller
}
$response = new Response();
return $response->html($html, 200, [
return $response->html($html, 200)->withHeaders([
'Content-Type' => 'text/html; charset=utf-8',
'Content-Disposition' => 'attachment; filename="Book-of-the-ERP.html"',
]);
......
This diff is collapsed.
......@@ -23,8 +23,7 @@ final class PdfExportService
$html = ob_get_clean();
$response = new Response();
return $response->html($html, 200, [
'Content-Type' => 'text/html; charset=utf-8',
return $response->html($html, 200)->withHeaders([
'Content-Disposition' => 'attachment; filename="' . $filename . '"',
]);
}
......@@ -61,7 +60,7 @@ final class PdfExportService
@unlink($tmpOutput);
$response = new Response();
return $response->html($pdfContent, 200, [
return $response->html($pdfContent, 200)->withHeaders([
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="' . $filename . '"',
'Content-Length' => (string) strlen($pdfContent),
......@@ -71,8 +70,7 @@ final class PdfExportService
}
$response = new Response();
return $response->html($html, 200, [
'Content-Type' => 'text/html; charset=utf-8',
return $response->html($html, 200)->withHeaders([
'Content-Disposition' => 'attachment; filename="' . str_replace('.pdf', '.html', $filename) . '"',
]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment