Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TCPDF Browser Popup Title

Tags:

php

tcpdf

EDIT

in accordance with @Will suggestions here is a simplified question...

Is there a tag I can use in the TCPDF PDF Creator file (example_003.php) to set the browser title to be anything other than the full URL of the php file?

I have tried this amongst lots of other things but it doesn't seem to play.

$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Author');
$pdf->SetTitle('Title');
$pdf->SetSubject('Subject');
$pdf->SetKeywords('Keywords');
$pdf->setHeaderData($ht='Browser Title?');

Any help would be great, thanks

like image 430
Justin Erswell Avatar asked Nov 13 '22 19:11

Justin Erswell


1 Answers

Whether or not a browser will display anything other than the URL for a downloaded file (regardless of whether or not the browser displays the PDF) is entirely vendor specific. My testing doesn't indicate that any data from the PDF is displayed in the title bar of the browser.

Something you can do is give the PDF file an alternate filename so that when the user saves the file they don't get a weird .php extension on their PDF. You do this with the Content-Disposition HTTP header. In PHP it could be done like this:

header('Content-Disposition: attachment; filename=document-name.pdf');
like image 160
A. R. Younce Avatar answered Dec 08 '22 00:12

A. R. Younce