2

I'm using this to output a pdf document :

$response = new \Symfony\Component\HttpFoundation\Response(file_get_contents($thefile), 200, [
    'Content-Description' => 'File transfer',
    'Content-Disposition' => 'filename="' . $filename . '"',
    'Content-Transfer-Encoding' => 'binary',
    'Content-Type' => 'application/pdf',
]);

unlink($thefile);

$response->send();

In the generated page, the header title is the link to the page.

How can I customize the title ?

trogne
  • 3,402
  • 3
  • 33
  • 50

2 Answers2

-1

You have to include the title inside the pdf.

Anonym
  • 1
-2

I just have to generate the pdf from a script as src of an iframe !

This way the head title is kept !

<head>
  <title>THE TITLE</title>
</head>
<body>
  <iframe src="process.php"></iframe>
</body>
</html>

Or I could ajax the php script, and return the result in a container element (eg div)

trogne
  • 3,402
  • 3
  • 33
  • 50